X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresInstaller.php;h=cb1b47e1e3a8ef0702804abdca86aa8ece2f0da7;hb=f428f95ac49e71bde47bc982e31ff60b3ef41706;hp=906768f489978b024ce7cc1d16b9c6acf962f9f2;hpb=944b93ee740d491ec6353f3fa5a439db41de97b8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 906768f489..cb1b47e1e3 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -21,6 +21,10 @@ * @ingroup Deployment */ +use Wikimedia\Rdbms\Database; +use Wikimedia\Rdbms\DBQueryError; +use Wikimedia\Rdbms\DBConnectionError; + /** * Class for setting up the MediaWiki database using Postgres. * @@ -42,7 +46,8 @@ class PostgresInstaller extends DatabaseInstaller { '_InstallUser' => 'postgres', ]; - public $minimumVersion = '8.3'; + public static $minimumVersion = '8.3'; + protected static $notMiniumumVerisonMessage = 'config-postgres-old'; public $maxRoleSearchDepth = 5; protected $pgConns = []; @@ -120,8 +125,9 @@ class PostgresInstaller extends DatabaseInstaller { // Check version $version = $conn->getServerVersion(); - if ( version_compare( $version, $this->minimumVersion ) < 0 ) { - return Status::newFatal( 'config-postgres-old', $this->minimumVersion, $version ); + $status = static::meetsMinimumRequirement( $conn->getServerVersion() ); + if ( !$status->isOK() ) { + return $status; } $this->setVar( 'wgDBuser', $this->getVar( '_InstallUser' ) ); @@ -590,7 +596,7 @@ class PostgresInstaller extends DatabaseInstaller { return $status; } - /** @var $conn DatabasePostgres */ + /** @var DatabasePostgres $conn */ $conn = $status->value; if ( $conn->tableExists( 'archive' ) ) { @@ -633,7 +639,7 @@ class PostgresInstaller extends DatabaseInstaller { public function setupPLpgSQL() { // Connect as the install user, since it owns the database and so is - // the user that needs to run "CREATE LANGAUGE" + // the user that needs to run "CREATE LANGUAGE" $status = $this->getPgConnection( 'create-schema' ); if ( !$status->isOK() ) { return $status;