Commit c462ab10 authored by Dries's avatar Dries

- Patch #299661 by smk-ka, oadaeh, et al: install.php does not correctly check database settings.

parent f0979758
...@@ -746,10 +746,6 @@ abstract class Database { ...@@ -746,10 +746,6 @@ abstract class Database {
/** /**
* Process the configuration file for database information. * Process the configuration file for database information.
*
* Because the config file accepts various "fallback" configurations, we have
* to parse the configuration array out into a standardized "complete" form,
* applying defaults where necessary.
*/ */
final protected static function parseConnectionInfo() { final protected static function parseConnectionInfo() {
global $databases; global $databases;
...@@ -759,17 +755,7 @@ abstract class Database { ...@@ -759,17 +755,7 @@ abstract class Database {
} }
$databaseInfo = $databases; $databaseInfo = $databases;
// If no database key is specified, default to default.
if (!is_array($databaseInfo)) {
$databaseInfo = array('default' => $databaseInfo);
}
foreach ($databaseInfo as $index => $info) { foreach ($databaseInfo as $index => $info) {
// If no targets are specified, default to one default.
if (!is_array($databaseInfo[$index])) {
$databaseInfo[$index] = array('default' => $info);
}
foreach ($databaseInfo[$index] as $target => $value) { foreach ($databaseInfo[$index] as $target => $value) {
// If there is no "driver" property, then we assume it's an array of // If there is no "driver" property, then we assume it's an array of
// possible connections for this target. Pick one at random. That // possible connections for this target. Pick one at random. That
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
* 'username' => 'username', * 'username' => 'username',
* 'password' => 'password', * 'password' => 'password',
* 'host' => 'localhost', * 'host' => 'localhost',
* 'port' => 3306,
* ); * );
* *
* The "driver" property indicates what Drupal database driver the * The "driver" property indicates what Drupal database driver the
...@@ -87,28 +88,17 @@ ...@@ -87,28 +88,17 @@
* $databases['default']['default'] = $info_array; * $databases['default']['default'] = $info_array;
* $databases['default']['slave'][] = $info_array; * $databases['default']['slave'][] = $info_array;
* $databases['default']['slave'][] = $info_array; * $databases['default']['slave'][] = $info_array;
* $databases['extra'] = $info_array; * $databases['extra']['default'] = $info_array;
* *
* In the above example, $info_array is an array of settings described above. * In the above example, $info_array is an array of settings described above.
* The first line sets a "default" database that has one master database * The first line sets a "default" database that has one master database
* (the second level default). The second and third lines create an array * (the second level default). The second and third lines create an array
* of potential slave databases. Drupal will select one at random for a given * of potential slave databases. Drupal will select one at random for a given
* request as needed. The fourth line creates a new database with a name of * request as needed. The fourth line creates a new database with a name of
* "extra". Since no target is specified, it is assumed to be "default", that * "extra".
* is, only one server.
* *
* For a single database configuration, the following is sufficient: * For a single database configuration, the following is sufficient:
* *
* $databases = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* );
*
* That is equivalent to:
*
* $databases['default']['default'] = array( * $databases['default']['default'] = array(
* 'driver' => 'mysql', * 'driver' => 'mysql',
* 'database' => 'databasename', * 'database' => 'databasename',
...@@ -141,21 +131,21 @@ ...@@ -141,21 +131,21 @@
* ); * );
* *
* Database configuration format: * Database configuration format:
* $databases = array( * $databases['default']['default'] = array(
* 'driver' => 'mysql', * 'driver' => 'mysql',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'username', * 'username' => 'username',
* 'password' => 'password', * 'password' => 'password',
* 'host' => 'localhost', * 'host' => 'localhost',
* ); * );
* $databases = array( * $databases['default']['default'] = array(
* 'driver' => 'pgsql', * 'driver' => 'pgsql',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'username', * 'username' => 'username',
* 'password' => 'password', * 'password' => 'password',
* 'host' => 'localhost', * 'host' => 'localhost',
* ); * );
* $databases = array( * $databases['default']['default'] = array(
* 'driver' => 'sqlite', * 'driver' => 'sqlite',
* 'database' => 'databasefilename', * 'database' => 'databasefilename',
* ); * );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment