BUGFIX Fixed installer not submitting correct details when environment file is in use

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@98664 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sharvey 2010-02-10 03:38:53 +00:00 committed by Sam Minnee
parent 260239fc5a
commit af4238e275

View File

@ -42,7 +42,19 @@ foreach($envFiles as $envFile) {
// Load database config
if(isset($_REQUEST['db'])) {
$databaseConfig = $_REQUEST['db'];
// Disabled inputs don't submit anything - we need to use the environment (except the database name)
if($usingEnv) {
$_REQUEST['db'] = $databaseConfig = array(
"type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : "MySQLDatabase",
"server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : "localhost",
"username" => defined('SS_DATABASE_USERNAME') ? SS_DATABASE_USERNAME : "root",
"password" => defined('SS_DATABASE_PASSWORD') ? SS_DATABASE_PASSWORD : "",
"database" => $_REQUEST['db']['database'],
);
} else {
// Normal behaviour without the environment
$databaseConfig = $_REQUEST['db'];
}
} else {
$_REQUEST['db'] = $databaseConfig = array(
"type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : "MySQLDatabase",
@ -54,7 +66,17 @@ if(isset($_REQUEST['db'])) {
}
if(isset($_REQUEST['admin'])) {
$adminConfig = $_REQUEST['admin'];
// Disabled inputs don't submit anything - we need to use the environment (except the database name)
if($usingEnv) {
$_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',
'firstname' => $_REQUEST['admin']['firstname'],
'surname' => $_REQUEST['admin']['surname']
);
} else {
$adminConfig = $_REQUEST['admin'];
}
} else {
$_REQUEST['admin'] = $adminConfig = array(
'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin',