summaryrefslogtreecommitdiff
path: root/includes/database.pgsql.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-10-22 16:46:41 +0000
committerDries Buytaert <dries@buytaert.net>2006-10-22 16:46:41 +0000
commite2ed7b8eef8b0f9687767e33c6530b0ab98da5c2 (patch)
tree2deaf529e26e87a41076d9624e5d33a8cfc5fd63 /includes/database.pgsql.inc
parent756cb72d33de658d03c144b1b8e42417142adb81 (diff)
downloadbrdo-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.pgsql.inc')
-rw-r--r--includes/database.pgsql.inc33
1 files changed, 19 insertions, 14 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index f1500c8e8..b5b53b955 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -17,26 +17,31 @@
function db_status_report() {
$t = get_t();
- $form['pgsql'] = array();
-
- if (function_exists('pg_version')) {
- $version = pg_version();
- if (version_compare($version['server'], DRUPAL_MINIMUM_PGSQL) < 0) {
- $form['pgsql']['severity'] = REQUIREMENT_ERROR;
- $form['pgsql']['description'] = $t('Your PostgreSQL Server is too old. Drupal requires at least PostgreSQL %version.', array('%version' => DRUPAL_MINIMUM_PGSQL));
- }
- }
- else {
- $version = array('server' => $t('Unknown'));
- }
+ $version = db_version();
- $form['pgsql']['title'] = $t('PostgreSQL database');
- $form['pgsql']['value'] = $version['server'];
+ $form['pgsql'] = array(
+ 'title' => $t('PostgreSQL database'),
+ 'value' => $version,
+ );
+
+ if (version_compare($version, DRUPAL_MINIMUM_PGSQL) < 0) {
+ $form['pgsql']['severity'] = REQUIREMENT_ERROR;
+ $form['pgsql']['description'] = $t('Your PostgreSQL Server is too old. Drupal requires at least PostgreSQL %version.', array('%version' => DRUPAL_MINIMUM_PGSQL));
+ }
return $form;
}
/**
+ * Returns the version of the database server currently in use.
+ *
+ * @return Database server version
+ */
+function db_version() {
+ return db_result(db_query("SHOW SERVER_VERSION"));
+}
+
+/**
* Initialize a database connection.
*
* Note that you can change the pg_connect() call to pg_pconnect() if you