Changed permission checks to check for the right things (merged from 2.0.2 branch, r37922)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@40479 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
aoneil 2007-08-20 00:28:42 +00:00
parent a30689cc72
commit 4e0fdcb5cf
2 changed files with 9 additions and 15 deletions

0
.htaccess Normal file
View File

View File

@ -7,7 +7,6 @@
ini_set('max_execution_time', 300); ini_set('max_execution_time', 300);
// Load database config // Load database config
if(isset($_REQUEST['mysql'])) { if(isset($_REQUEST['mysql'])) {
$databaseConfig = $_REQUEST['mysql']; $databaseConfig = $_REQUEST['mysql'];
@ -20,7 +19,7 @@ if(isset($_REQUEST['mysql'])) {
); );
} }
$alreadyInstalled = (file_exists('assets') || file_exists('mysite/_config.php')); $alreadyInstalled = (file_exists('mysite/_config.php') || file_exists('tutorial/_config.php'));
if(file_exists('sapphire/silverstripe_version')) { if(file_exists('sapphire/silverstripe_version')) {
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version'); $sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
@ -38,7 +37,9 @@ if(file_exists('sapphire/silverstripe_version')) {
$req = new InstallRequirements(); $req = new InstallRequirements();
$req->check(); $req->check();
if($req->hasErrors()) $hasErrorOtherThanDatabase = true; if($req->hasErrors()) {
$hasErrorOtherThanDatabase = true;
}
if($databaseConfig) { if($databaseConfig) {
$dbReq = new InstallRequirements(); $dbReq = new InstallRequirements();
@ -108,17 +109,15 @@ class InstallRequirements {
$this->requireFile('sapphire', array("File permissions", "sapphire/ folder exists", "There's no sapphire folder.")); $this->requireFile('sapphire', array("File permissions", "sapphire/ folder exists", "There's no sapphire folder."));
$this->requireFile('cms', array("File permissions", "cms/ folder exists", "There's no cms folder.")); $this->requireFile('cms', array("File permissions", "cms/ folder exists", "There's no cms folder."));
$this->requireFile('jsparty', array("File permissions", "jsparty/ folder exists", "There's no jsparty folder.")); $this->requireFile('jsparty', array("File permissions", "jsparty/ folder exists", "There's no jsparty folder."));
$this->requireWriteable('.', array("File permissions", "Is the base folder writeable?", null)); $this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
$this->requireWriteable('mysite', array("File permissions", "Is the mysite/ folder writeable?", null)); $this->requireWriteable('mysite', array("File permissions", "Is the mysite/ folder writeable?", null));
$this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
if(!is_writeable(dirname(tempnam('adfadsfdas','')))) { if(!is_writeable(dirname(tempnam('adfadsfdas','')))) {
$this->error(array("File permissions", "Is the temporary folder writeable?", "The temporary folder isn't writeable!")); $this->error(array("File permissions", "Is the temporary folder writeable?", "The temporary folder isn't writeable!"));
} }
// Check that there's no stray files to get in the way
//$this->moveFileOutOfTheWay('.htaccess', "Please remove the current .htaccess file.");
//$this->moveFileOutOfTheWay('mysite/_config.php', "Please remove the current mysite/_config.php file.");
// Check for rewriting // Check for rewriting
$webserver = strip_tags(trim($_SERVER['SERVER_SIGNATURE'])); $webserver = strip_tags(trim($_SERVER['SERVER_SIGNATURE']));
@ -476,11 +475,6 @@ class Installer extends InstallRequirements {
<? <?
flush(); flush();
echo "<li>Creating 'assets' folder...</li>";
flush();
$this->makeFolder('assets');
// Write the config file // Write the config file
$template = $_POST['template'] == 'tutorial' ? 'tutorial' : 'mysite'; $template = $_POST['template'] == 'tutorial' ? 'tutorial' : 'mysite';