mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
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:
parent
af217502fd
commit
1670071825
16
install.php
16
install.php
@ -809,9 +809,10 @@ class Installer extends InstallRequirements {
|
||||
$phpVersion = urlencode(phpversion());
|
||||
$encWebserver = urlencode($webserver);
|
||||
$type = $config['db']['type'];
|
||||
$dbConfig = $config['db'][$type];
|
||||
|
||||
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());
|
||||
} else {
|
||||
$databaseVersion = $type;
|
||||
@ -845,7 +846,7 @@ global \$project;
|
||||
\$project = 'mysite';
|
||||
|
||||
global \$database;
|
||||
\$database = '{$config['db'][$type]['database']}';
|
||||
\$database = '{$dbConfig['database']}';
|
||||
|
||||
require_once('conf/ConfigureFromEnv.php');
|
||||
|
||||
@ -868,8 +869,7 @@ PHP
|
||||
$this->statusMessage("Setting up 'mysite/_config.php'...");
|
||||
|
||||
$devServers = $this->var_export_array_nokeys(explode("\n", $_POST['devsites']));
|
||||
|
||||
$escapedPassword = addslashes($config['db'][$type]['password']);
|
||||
$escapedPassword = addslashes($dbConfig['password']);
|
||||
$this->writeToFile("mysite/_config.php", <<<PHP
|
||||
<?php
|
||||
|
||||
@ -879,11 +879,11 @@ global \$project;
|
||||
global \$databaseConfig;
|
||||
\$databaseConfig = array(
|
||||
"type" => '{$type}',
|
||||
"server" => '{$config['db'][$type]['server']}',
|
||||
"username" => '{$config['db'][$type]['username']}',
|
||||
"server" => '{$dbConfig['server']}',
|
||||
"username" => '{$dbConfig['username']}',
|
||||
"password" => '{$escapedPassword}',
|
||||
"database" => '{$config['db'][$type]['database']}',
|
||||
"path" => '{$config['db'][$type]['path']}',
|
||||
"database" => '{$dbConfig['database']}',
|
||||
"path" => '{$dbConfig['path']}',
|
||||
);
|
||||
|
||||
// Sites running on the following servers will be
|
||||
|
Loading…
Reference in New Issue
Block a user