From: Tim Starling Date: Sat, 10 Jan 2009 00:53:26 +0000 (+0000) Subject: * (bug 16937) Show appropriate error message when someone attempts an install on... X-Git-Tag: 1.31.0-rc.0~43471 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=54c6f867df459981877b641e68686ea0546e70a4;p=lhc%2Fweb%2Fwiklou.git * (bug 16937) Show appropriate error message when someone attempts an install on PostgreSQL 7.3 or earlier. * Fix some issues with the earlier migration of getServerVersion() to numeric only. --- diff --git a/config/index.php b/config/index.php index f8b5966c8c..0a2d290b64 100644 --- a/config/index.php +++ b/config/index.php @@ -894,7 +894,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { continue; } - print "
  • Connected to $myver"; + print "
  • Connected to {$conf->DBtype} $myver"; if ($conf->DBtype == 'mysql') { if( version_compare( $myver, "4.0.14" ) < 0 ) { print "
  • \n"; @@ -945,7 +945,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $wgDatabase->selectDB( $wgDBname ); } else if ($conf->DBtype == 'postgres') { - if( version_compare( $myver, "PostgreSQL 8.0" ) < 0 ) { + if( version_compare( $myver, "8.0" ) < 0 ) { dieout( "Postgres 8.0 or later is required. Aborting." ); } } diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 00eddf5db1..91fd516c20 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1056,7 +1056,13 @@ class DatabasePostgres extends Database { */ function getServerVersion() { $versionInfo = pg_version( $this->mConn ); - $this->numeric_version = $versionInfo['server']; + if ( isset( $versionInfo['server'] ) ) { + $this->numeric_version = $versionInfo['server']; + } else { + // There's no way to identify the precise version before 7.4, but + // it doesn't matter anyway since we're just going to give an error. + $this->numeric_version = '7.3 or earlier'; + } return $this->numeric_version; }