+ function getConnection($database = null) {
+ $status = Status::newGood();
+
+ if( is_null( $database ) ) {
+ $dbname = $this->getVar( 'wgDBname' );
+ $dbuser = $this->getVar( 'wgDBuser' );
+ $dbpass = $this->getVar( 'wgDBpassword' );
+ } else {
+ $dbname = $database;
+ $dbuser = $this->getVar( '_InstallUser' );
+ $dbpass = $this->getVar( '_InstallPassword' );
+ }
+
+ try {
+ $this->db = new DatabasePostgres(
+ $this->getVar( 'wgDBserver' ),
+ $dbuser, $dbpass, $dbname );
+ $status->value = $this->db;
+ } catch ( DBConnectionError $e ) {
+ $status->fatal( 'config-connection-error', $e->getMessage() );
+ }
+ return $status;
+ }
+