diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-28 08:40:33 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-28 08:40:33 +0000 |
commit | 395199859d169409f62f0676bf5265278967d5b1 (patch) | |
tree | 8d742d2f9641c3f776e901e50540bc359fe3065f | |
parent | 762ca25ecfb0bcc418d00bfdafea80485ac001ca (diff) | |
download | brdo-395199859d169409f62f0676bf5265278967d5b1.tar.gz brdo-395199859d169409f62f0676bf5265278967d5b1.tar.bz2 |
- Patch #299330 by justinrandell, Damien Tournoud: select MySQL driver by default -- less clicking
-rw-r--r-- | includes/install.inc | 7 | ||||
-rw-r--r-- | install.php | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/includes/install.inc b/includes/install.inc index 658ef26a2..4c79d832c 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -227,6 +227,13 @@ function drupal_detect_database_types() { } } + // Usability: unconditionnally put the MySQL driver on top. + if (isset($databases['mysql'])) { + $mysql_database = $databases['mysql']; + unset($databases['mysql']); + $databases = array('mysql' => $mysql_database) + $databases; + } + return $databases; } diff --git a/install.php b/install.php index 30355e4ad..c606aecbe 100644 --- a/install.php +++ b/install.php @@ -194,7 +194,8 @@ function install_change_settings($profile = 'default', $install_locale = '') { $conf_path = './' . conf_path(FALSE, TRUE); $settings_file = $conf_path . '/settings.php'; - $database = $databases['default']['default']; + $database = isset($databases['default']['default']) ? $databases['default']['default'] : array(); + // We always need this because we want to run form_get_errors. include_once './includes/form.inc'; install_task_list('database'); @@ -237,7 +238,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting '#title' => st('Database driver'), '#required' => TRUE, '#options' => $drivers, - '#default_value' => !empty($database['driver']) ? $database['driver'] : current($drivers), + '#default_value' => !empty($database['driver']) ? $database['driver'] : current(array_keys($drivers)), '#description' => st('The type of database your @drupal data will be stored in.', array('@drupal' => drupal_install_profile_name())), ); $database_description = st('The name of the database your @drupal data will be stored in. It must exist on your server before @drupal can be installed.', array('@drupal' => drupal_install_profile_name())); |