ENHANCEMENT Added checkbox to switch off using the environment during install if it's available

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@98677 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sharvey 2010-02-10 05:02:34 +00:00 committed by Sam Minnee
parent 8dd4256bfc
commit 41bd835be2

View File

@ -40,10 +40,16 @@ foreach($envFiles as $envFile) {
}
}
// This is used by the checkbox to select whether to prefer environment or not
$shouldUseEnv = false;
if(isset($_REQUEST['useEnv']) && $_REQUEST['useEnv']) {
$shouldUseEnv = true;
}
// Load database config
if(isset($_REQUEST['db'])) {
// Disabled inputs don't submit anything - we need to use the environment (except the database name)
if($usingEnv) {
if($usingEnv && $shouldUseEnv) {
$_REQUEST['db'] = $databaseConfig = array(
"type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : "MySQLDatabase",
"server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : "localhost",
@ -67,7 +73,7 @@ if(isset($_REQUEST['db'])) {
if(isset($_REQUEST['admin'])) {
// Disabled inputs don't submit anything - we need to use the environment (except the database name)
if($usingEnv) {
if($usingEnv && $shouldUseEnv) {
$_REQUEST['admin'] = $adminConfig = array(
'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin',
'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : 'password',