MINOR Additional fixes for install.php (see r101063)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@101067 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
ischommer 2010-03-15 21:19:29 +00:00 committed by Sam Minnee
parent af217502fd
commit 1670071825

View File

@ -809,9 +809,10 @@ class Installer extends InstallRequirements {
$phpVersion = urlencode(phpversion()); $phpVersion = urlencode(phpversion());
$encWebserver = urlencode($webserver); $encWebserver = urlencode($webserver);
$type = $config['db']['type']; $type = $config['db']['type'];
$dbConfig = $config['db'][$type];
if($type == 'MySQLDatabase') { if($type == 'MySQLDatabase') {
$conn = @mysql_connect($config['db'][$type]['server'], null, null); $conn = @mysql_connect($dbConfig['server'], null, null);
$databaseVersion = urlencode('MySQLDatabase: ' . mysql_get_server_info()); $databaseVersion = urlencode('MySQLDatabase: ' . mysql_get_server_info());
} else { } else {
$databaseVersion = $type; $databaseVersion = $type;
@ -845,7 +846,7 @@ global \$project;
\$project = 'mysite'; \$project = 'mysite';
global \$database; global \$database;
\$database = '{$config['db'][$type]['database']}'; \$database = '{$dbConfig['database']}';
require_once('conf/ConfigureFromEnv.php'); require_once('conf/ConfigureFromEnv.php');
@ -866,10 +867,9 @@ PHP
} else { } else {
$this->statusMessage("Setting up 'mysite/_config.php'..."); $this->statusMessage("Setting up 'mysite/_config.php'...");
$devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
$escapedPassword = addslashes($config['db'][$type]['password']); $devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
$escapedPassword = addslashes($dbConfig['password']);
$this->writeToFile("mysite/_config.php", <<<PHP $this->writeToFile("mysite/_config.php", <<<PHP
<?php <?php
@ -879,11 +879,11 @@ global \$project;
global \$databaseConfig; global \$databaseConfig;
\$databaseConfig = array( \$databaseConfig = array(
"type" => '{$type}', "type" => '{$type}',
"server" => '{$config['db'][$type]['server']}', "server" => '{$dbConfig['server']}',
"username" => '{$config['db'][$type]['username']}', "username" => '{$dbConfig['username']}',
"password" => '{$escapedPassword}', "password" => '{$escapedPassword}',
"database" => '{$config['db'][$type]['database']}', "database" => '{$dbConfig['database']}',
"path" => '{$config['db'][$type]['path']}', "path" => '{$dbConfig['path']}',
); );
// Sites running on the following servers will be // Sites running on the following servers will be