mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
Installer will now detect if you have an _ss_environment.php, and if so, use conf/ConfigureFromEnv.php
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@61633 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9c15d0dae9
commit
00f94e8867
31
install.php
31
install.php
@ -10,10 +10,12 @@ ini_set('max_execution_time', 300);
|
||||
session_start();
|
||||
|
||||
// Include environment files
|
||||
$usingEnv = false;
|
||||
$envFiles = array('_ss_environment.php', '../_ss_environment.php', '../../_ss_environment.php');
|
||||
foreach($envFiles as $envFile) {
|
||||
if(@file_exists($envFile)) {
|
||||
include($envFile);
|
||||
$usingEnv = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -624,8 +626,34 @@ SSViewer::set_theme('blackcandy');
|
||||
PHP;
|
||||
}
|
||||
|
||||
echo "<li>Creating '$template/_config.php'...</li>";
|
||||
|
||||
global $usingEnv;
|
||||
if($usingEnv) {
|
||||
echo "<li>Creating '$template/_config.php' for use with _ss_environment.php...</li>\n";
|
||||
flush();
|
||||
$this->createFile("$template/_config.php", <<<PHP
|
||||
<?php
|
||||
|
||||
global \$project;
|
||||
\$project = '$template';
|
||||
|
||||
global \$database;
|
||||
\$database = "{$config['mysql']['database']}";
|
||||
|
||||
require_once("conf/ConfigureFromEnv.php");
|
||||
|
||||
$theme
|
||||
|
||||
?>
|
||||
PHP
|
||||
);
|
||||
|
||||
|
||||
} else {
|
||||
echo "<li>Creating '$template/_config.php'...</li>\n";
|
||||
flush();
|
||||
|
||||
|
||||
|
||||
$devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
|
||||
|
||||
@ -656,6 +684,7 @@ $theme
|
||||
?>
|
||||
PHP
|
||||
);
|
||||
}
|
||||
|
||||
echo "<li>Creating '.htaccess' file...</li>";
|
||||
flush();
|
||||
|
Loading…
Reference in New Issue
Block a user