mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
MINOR: Removed no-longer-used createHtAccessAlternative()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.3@66916 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c59f674f36
commit
492be9705f
47
install.php
47
install.php
@ -921,53 +921,6 @@ TEXT
|
||||
|
||||
$this->createFile('.htaccess', $start . $rewrite . $end);
|
||||
}
|
||||
|
||||
function createHtaccessAlternative() {
|
||||
$start = "### SILVERSTRIPE START ###\n";
|
||||
$end= "\n### SILVERSTRIPE END ###";
|
||||
|
||||
$base = dirname($_SERVER['SCRIPT_NAME']);
|
||||
if($base != '.') $baseClause = "RewriteBase $base\n";
|
||||
|
||||
$rewrite = <<<TEXT
|
||||
<IfModule mod_dir.c>
|
||||
DirectorySlash Off
|
||||
</IfModule>
|
||||
|
||||
<Files *.ss>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
Allow from 127.0.0.1
|
||||
</Files>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
$baseClause
|
||||
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
|
||||
|
||||
RewriteCond %{REQUEST_URI} ^(.*)$
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule .* $_SERVER[DOCUMENT_ROOT]/sapphire/main.php?url=%1&%{QUERY_STRING} [L]
|
||||
</IfModule>
|
||||
TEXT;
|
||||
|
||||
if(file_exists($this->getBaseDir() . '.htaccess')) {
|
||||
$htaccess = file_get_contents($this->getBaseDir() . '.htaccess');
|
||||
|
||||
if(strpos($htaccess, '### SILVERSTRIPE START ###') === false && strpos($htaccess, '### SILVERSTRIPE END ###') === false) {
|
||||
$htaccess .= "\n### SILVERSTRIPE START ###\n### SILVERSTRIPE END ###\n";
|
||||
}
|
||||
|
||||
if(strpos($htaccess, '### SILVERSTRIPE START ###') !== false && strpos($htaccess, '### SILVERSTRIPE END ###') !== false) {
|
||||
$start = substr($htaccess, 0, strpos($htaccess, '### SILVERSTRIPE START ###')) . "### SILVERSTRIPE START ###\n";
|
||||
$end = "\n" . substr($htaccess, strpos($htaccess, '### SILVERSTRIPE END ###'));
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n\nRewrite is $rewrite\n";
|
||||
|
||||
$this->createFile('.htaccess', $start . $rewrite . $end);
|
||||
}
|
||||
|
||||
function restoreHtaccess() {
|
||||
$start = "### SILVERSTRIPE START ###\n";
|
||||
|
Loading…
Reference in New Issue
Block a user