* (bug 16937) Show appropriate error message when someone attempts an install on...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 10 Jan 2009 00:53:26 +0000 (00:53 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 10 Jan 2009 00:53:26 +0000 (00:53 +0000)
* Fix some issues with the earlier migration of getServerVersion() to numeric only.

config/index.php
includes/db/DatabasePostgres.php

index f8b5966..0a2d290 100644 (file)
@@ -894,7 +894,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                        continue;
                }
 
-               print "<li>Connected to $myver";
+               print "<li>Connected to {$conf->DBtype} $myver";
                if ($conf->DBtype == 'mysql') {
                        if( version_compare( $myver, "4.0.14" ) < 0 ) {
                                print "</li>\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( "<b>Postgres 8.0 or later is required</b>. Aborting." );
                        }
                }
index 00eddf5..91fd516 100644 (file)
@@ -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;
        }