From 448a729a2918a8c2d678ee6299f0450c2fce67a0 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sat, 14 Apr 2012 20:16:27 +1200 Subject: [PATCH] MINOR Removed unused rewritetest.php --- rewritetest.php | 166 ------------------------------------------------ 1 file changed, 166 deletions(-) delete mode 100644 rewritetest.php diff --git a/rewritetest.php b/rewritetest.php deleted file mode 100644 index fe1c9b7..0000000 --- a/rewritetest.php +++ /dev/null @@ -1,166 +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 = <<