From 80b4d24e186a1a834c04d99e1f5164b8c21c7494 Mon Sep 17 00:00:00 2001 From: sharvey Date: Thu, 18 Mar 2010 23:00:06 +0000 Subject: [PATCH] MINOR Removed rewritetest.php, it's not being used and doesn't need to be bundled with the installer git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@101352 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- rewritetest.php | 165 ------------------------------------------------ 1 file changed, 165 deletions(-) delete mode 100644 rewritetest.php diff --git a/rewritetest.php b/rewritetest.php deleted file mode 100644 index de9d6f1..0000000 --- a/rewritetest.php +++ /dev/null @@ -1,165 +0,0 @@ -home/successfullyinstalled. - "; -} else { - $modRewriteWorking = performModRewriteTest(); - - if(!$modRewriteWorking) { - createHtaccessAlternative(); - $modRewriteWorking = performModRewriteTest(); - } - - if($modRewriteWorking) { - echo "mod_rewrite is working! I will now try and direct you to - home/successfullyinstalled to confirm that the installation was successful. - - "; - } else { - restoreHtaccess(); - - echo "mod_rewrite doesn't appear to be working. Make sure:" . - "" . - "Please check these options, then refresh this page." . - "If you believe that your configuration is correct, click here to proceed anyway."; - } -} - -function performModRewriteTest() { - $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'; - $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; - } - } - } - - return false; -} - -function createHtaccess() { - $start = "### SILVERSTRIPE START ###\n"; - $end= "\n### SILVERSTRIPE END ###"; - $base = dirname($_SERVER['SCRIPT_NAME']); - - $rewrite = <<