From d2b772726c5914a225abdf7bf8d531446088dff2 Mon Sep 17 00:00:00 2001 From: sminnee Date: Wed, 13 Oct 2010 02:49:22 +0000 Subject: [PATCH] BUGFIX Installer does not require .htaccess file to be writable if using IIS 7 and 7.5. We assume any other server has some form of .htaccess file (from r98850) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112104 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- install.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index 38680b5..a0f99fe 100644 --- a/install.php +++ b/install.php @@ -283,7 +283,13 @@ class InstallRequirements { $this->requireFile('mysite', array("File permissions", "mysite/ folder exists", "There's no mysite 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->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null)); + + + // Special case: IIS 7 and 7.5 don't need an .htaccess file, so it shouldn't have to be writable + if(!(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false)) { + $this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null)); + } + $this->requireWriteable('mysite/_config.php', array("File permissions", "Is the mysite/_config.php file writeable?", null)); $this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null)); @@ -306,7 +312,7 @@ class InstallRequirements { $this->isRunningWebServer(array("Webserver Configuration", "Server software", "$webserver. Without Apache I can't tell if mod_rewrite is enabled.", $webserver)); if(function_exists('apache_get_modules')) { $this->requireApacheModule('mod_rewrite', array("Webserver Configuration", "mod_rewrite enabled", "You need mod_rewrite to run SilverStripe CMS, but it is not enabled.")); - } elseif(strpos($webserver, 'IIS') !== false) { + } elseif(strpos($webserver, 'IIS/7') !== false) { $this->requireIISRewriteModule('IIS_UrlRewriteModule', array("Webserver Configuration", "IIS URL Rewrite Module enabled", "You need to enable the IIS URL Rewrite Module, but it is not installed or enabled. Download it for IIS 7 from http://www.iis.net/expand/URLRewrite")); } else { $this->warning(array("Webserver Configuration", "URL rewrite enabled", "I can't tell whether any rewriting module is running. You may need to configure a rewriting rule yourself."));