diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-10-22 16:46:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-10-22 16:46:41 +0000 |
commit | e2ed7b8eef8b0f9687767e33c6530b0ab98da5c2 (patch) | |
tree | 2deaf529e26e87a41076d9624e5d33a8cfc5fd63 /includes/database.mysql.inc | |
parent | 756cb72d33de658d03c144b1b8e42417142adb81 (diff) | |
download | brdo-e2ed7b8eef8b0f9687767e33c6530b0ab98da5c2.tar.gz brdo-e2ed7b8eef8b0f9687767e33c6530b0ab98da5c2.tar.bz2 |
- Patch #88705 by profix898 and sammys: made version checking work with PostgreSQL. (Critical bug)
Diffstat (limited to 'includes/database.mysql.inc')
-rw-r--r-- | includes/database.mysql.inc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 262a28c1c..b0ffd2692 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -18,22 +18,32 @@ function db_status_report($phase) { $t = get_t(); - $info = mysql_get_server_info(); + $version = db_version(); + $form['mysql'] = array( 'title' => $t('MySQL database'), - 'value' => ($phase == 'runtime') ? l($info, 'admin/logs/status/sql') : $info, + 'value' => ($phase == 'runtime') ? l($version, 'admin/logs/status/sql') : $version, ); - // Extract version number - list($version) = explode('-', $info); if (version_compare($version, DRUPAL_MINIMUM_MYSQL) < 0) { $form['mysql']['severity'] = REQUIREMENT_ERROR; $form['mysql']['description'] = $t('Your MySQL Server is too old. Drupal requires at least MySQL %version.', array('%version' => DRUPAL_MINIMUM_MYSQL)); } + return $form; } /** + * Returns the version of the database server currently in use. + * + * @return Database server version + */ +function db_version() { + list($version) = explode('-', mysql_get_server_info()); + return $version; +} + +/** * Initialize a database connection. * * Note that you can change the mysql_connect() call to mysql_pconnect() if you |