Problem/Motivation
The documentation in default.settings.php for Drupal 8 shows the following example for a database configuration:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'prefix' => 'main_',
'collation' => 'utf8_general_ci',
);
But the actual configuration is created as:
$databases['default']['default'] = array (
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
The current issue is that the order of the options doesn't match the one in the documentation.
Beta phase evaluation
<!--Uncomment the relevant rows for the issue. -->
Allowed in the beta since it is restricted to just documenation change to make it easier to use the setting.php file.
Proposed resolution
Update the documentation in default.settings.php to match the order of the options.
$databases['default']['default'] = array (
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
Remaining tasks
<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->
User interface changes
API changes
Fortunately, Drupal 7 set-up my settings settings.php file correctly. But I would not have been able to work it out from the examples given, which is more complicated than D6. The example is given as:
* Database configuration format:
* $databases['default']['default'] = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* );
But the actual configuration shows as follows, which I think is sufficiently different for the non-programmer (ie, shows "array" three times!):
$databases = array (
'default' =>
array (
'default' =>
array (
'driver' => 'mysql',
'database' => 'mydatabase',
'username' => 'myname',
'password' => 'mypassword',
'host' => 'msql.mydomain.com',
'port' => '',
),
),
);
I think the example should be very close to the follow, with an explanation of the arrays for programmers:
$databases = array ('default' => array ('default' => array (
'driver' => 'mysql',
'database' => 'mydatabase',
'username' => 'myname',
'password' => 'mypassword',
'host' => 'msql.mydomain.com',
'port' => '',
),
),
);