From 4e0fdcb5cf86f8b425cab6df0c8e93a6ab8a73b2 Mon Sep 17 00:00:00 2001 From: aoneil Date: Mon, 20 Aug 2007 00:28:42 +0000 Subject: [PATCH] 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 --- .htaccess | 0 install.php | 24 +++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..e69de29 diff --git a/install.php b/install.php index bdeba79..d07dfe6 100644 --- a/install.php +++ b/install.php @@ -7,7 +7,6 @@ ini_set('max_execution_time', 300); - // Load database config if(isset($_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')) { $sapphireVersionFile = file_get_contents('sapphire/silverstripe_version'); @@ -38,7 +37,9 @@ if(file_exists('sapphire/silverstripe_version')) { $req = new InstallRequirements(); $req->check(); -if($req->hasErrors()) $hasErrorOtherThanDatabase = true; +if($req->hasErrors()) { + $hasErrorOtherThanDatabase = true; +} if($databaseConfig) { $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('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->requireWriteable('.', array("File permissions", "Is the base folder writeable?", null)); - $this->requireWriteable('mysite', array("File permissions", "Is the mysite /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('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','')))) { $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 $webserver = strip_tags(trim($_SERVER['SERVER_SIGNATURE'])); @@ -476,11 +475,6 @@ class Installer extends InstallRequirements { Creating 'assets' folder..."; - flush(); - - $this->makeFolder('assets'); - // Write the config file $template = $_POST['template'] == 'tutorial' ? 'tutorial' : 'mysite';