diff --git a/install.php b/install.php
index 1bc1b3e..64f2135 100644
--- a/install.php
+++ b/install.php
@@ -629,10 +629,32 @@ class Installer extends InstallRequirements {
function install($config) {
if(isset($_SERVER['HTTP_HOST'])) {
?>
-
Installing SilverStripe...
-I am now running through the installation steps (this should take about 30 seconds)
-If you receive a fatal error, refresh this page to continue the installation
-
+
+ PHP 5 is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Installing SilverStripe...
+
I am now running through the installation steps (this should take about 30 seconds)
+
If you receive a fatal error, refresh this page to continue the installation
+
+statusMessage("Checking mod_rewrite works...");
- $modRewriteWorks = $this->checkModRewrite();
- } else {
- $modRewriteWorks = true;
- }
$_SESSION['username'] = $config['admin']['username'];
$_SESSION['password'] = $config['admin']['password'];
- if($modRewriteWorks && !$this->errors) {
+ if(!$this->errors) {
if(isset($_SERVER['HTTP_HOST'])) {
- echo "Installed SilverStripe successfully. I will now try and direct you to
- home/successfullyinstalled to confirm that the installation was successful.
-
- ";
+ $this->statusMessage("Checking that friendly URLs work...");
+ $this->checkModRewrite();
} else {
- echo "\nSilverStripe successfully installed\n";
+ echo "\n\nSilverStripe successfully installed\n";
}
}
@@ -960,65 +973,43 @@ TEXT;
}
function checkModRewrite() {
- if($this->performModRewriteTest() == true) {
- return true;
- }
-
- $this->createHtaccessAlternative();
-
- if($this->performModRewriteTest() == false) {
- echo "- ERROR: mod_rewrite not working, redirecting to mod_rewrite test page
";
-
- $this->restoreHtaccess();
-
- echo "I will now try and direct you to rewritetest to troubleshoot mod_rewrite
-
- ";
- return false;
- }
- return true;
- }
-
- function performModRewriteTest() {
if(!isset($_SERVER['HTTP_HOST']) || !$_SERVER['HTTP_HOST']) {
$this->statusMessage("Installer seems to be called from command-line, we're going to assume that rewriting is working.");
return true;
}
-
- $baseURL = dirname($_SERVER['SCRIPT_NAME']);
- if($baseURL == "/") {
- $baseURL = "";
- }
- // Check if mod_rewrite works properly
- $location = 'http://' . (isset($_SERVER['PHP_AUTH_USER']) ? "$_SERVER[PHP_AUTH_USER]:$_SERVER[PHP_AUTH_PW]@" : '') . $_SERVER['HTTP_HOST'] . $baseURL . '/InstallerTest/testrewrite';
- echo $location;
- @$testrewriting = file_get_contents($location);
-
- if($testrewriting == 'OK') {
- return true;
- }
-
- // Workaround for 'URL file-access is disabled in the server configuration' using curl
- if(function_exists('curl_init')) {
- $ch = curl_init($location);
- $fp = @fopen(dirname(tempnam('adfadsfdas','')) . '/rewritetest', "w");
-
- if($fp) {
- curl_setopt($ch, CURLOPT_FILE, $fp);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_exec($ch);
- curl_close($ch);
- fclose($fp);
- $testrewriting = file_get_contents(dirname(tempnam('adfadsfdas','')) . '/rewritetest');
- unlink(dirname(tempnam('adfadsfdas','')) . '/rewritetest');
- if($testrewriting == 'OK') {
- return true;
+ echo <<Testing...
+
+
+HTML;
}
function var_export_array_nokeys($array) {