From: Aaron Schulz Date: Wed, 28 Feb 2018 19:25:15 +0000 (-0800) Subject: Fix bogus DatabaseOracle::__construct() calls in OracleInstaller X-Git-Tag: 1.31.0-rc.0~480^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=6120c18829d7a3536b82da9881c998cb25831f7c Fix bogus DatabaseOracle::__construct() calls in OracleInstaller Change-Id: I12a35ac0eeb68e5da9ba07ba44d3522213e9de8e --- diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index e5418e43cc..659a1d7cc6 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -165,35 +165,30 @@ class OracleInstaller extends DatabaseInstaller { } public function openConnection() { - $status = Status::newGood(); - try { - $db = new DatabaseOracle( - $this->getVar( 'wgDBserver' ), - $this->getVar( '_InstallUser' ), - $this->getVar( '_InstallPassword' ), - $this->getVar( '_InstallDBname' ), - 0, - $this->getVar( 'wgDBprefix' ) - ); - $status->value = $db; - } catch ( DBConnectionError $e ) { - $this->connError = $e->db->lastErrno(); - $status->fatal( 'config-connection-error', $e->getMessage() ); - } - - return $status; + return $this->doOpenConnection(); } public function openSYSDBAConnection() { + return $this->doOpenConnection( DatabaseOracle::DBO_SYSDBA ); + } + + /** + * @param int $flags + * @return Status Status with DatabaseOracle or null as the value + */ + private function doOpenConnection( $flags = 0 ) { $status = Status::newGood(); try { - $db = new DatabaseOracle( - $this->getVar( 'wgDBserver' ), - $this->getVar( '_InstallUser' ), - $this->getVar( '_InstallPassword' ), - $this->getVar( '_InstallDBname' ), - DBO_SYSDBA, - $this->getVar( 'wgDBprefix' ) + $db = Database::factory( + 'oracle', + [ + 'host' => $this->getVar( 'wgDBserver' ), + 'user' => $this->getVar( '_InstallUser' ), + 'password' => $this->getVar( '_InstallPassword' ), + 'dbname' => $this->getVar( '_InstallDBname' ), + 'tablePrefix' => $this->getVar( 'wgDBprefix' ), + 'flags' => $flags + ] ); $status->value = $db; } catch ( DBConnectionError $e ) {