From 41bd835be251062af54aa52090795fce30e5a452 Mon Sep 17 00:00:00 2001 From: sharvey Date: Wed, 10 Feb 2010 05:02:34 +0000 Subject: [PATCH] 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 --- install.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index b769bc6..2c33edb 100644 --- a/install.php +++ b/install.php @@ -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',