* @ingroup Deployment
*/
+use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\DBQueryError;
+use Wikimedia\Rdbms\DBConnectionError;
+
/**
* Class for setting up the MediaWiki database using Postgres.
*
'_InstallUser' => 'postgres',
];
- public $minimumVersion = '8.3';
+ public static $minimumVersion = '8.3';
+ protected static $notMiniumumVerisonMessage = 'config-postgres-old';
public $maxRoleSearchDepth = 5;
protected $pgConns = [];
// 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' ) );
return $status;
}
- /** @var $conn DatabasePostgres */
+ /** @var DatabasePostgres $conn */
$conn = $status->value;
if ( $conn->tableExists( 'archive' ) ) {
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;