BUGFIX Checkbox for overriding the install from environment now checks for the file existance properly

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@98688 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sharvey 2010-02-10 21:19:05 +00:00 committed by Sam Minnee
parent 084acb6133
commit 62366a72e3

View File

@ -31,15 +31,25 @@ if($majorVersion < 5) {
// Include environment files
$usingEnv = false;
$envFileExists = false;
$envFiles = array('_ss_environment.php', '../_ss_environment.php', '../../_ss_environment.php');
foreach($envFiles as $envFile) {
if(@file_exists($envFile)) {
include_once($envFile);
$envFileExists = true;
$usingEnv = true;
break;
}
}
if($envFileExists) {
if(!empty($_REQUEST['useEnv'])) {
$usingEnv = true;
} else {
$usingEnv = false;
}
}
// Load database config
if(isset($_REQUEST['db'])) {
// Disabled inputs don't submit anything - we need to use the environment (except the database name)