Add getConnection() for Oracle
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Sep 2010 19:09:27 +0000 (19:09 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Sep 2010 19:09:27 +0000 (19:09 +0000)
includes/installer/OracleInstaller.php

index 0280836..84d89f5 100644 (file)
@@ -89,7 +89,22 @@ class OracleInstaller extends DatabaseInstaller {
        }
 
        public function getConnection() {
-               // TODO
+               $status = Status::newGood();
+               try {
+                       $this->db = new DatabaseOracle(
+                               $this->getVar( 'wgDBserver' ),
+                               $this->getVar( '_InstallUser' ),
+                               $this->getVar( '_InstallPassword' ),
+                               false,
+                               false,
+                               0,
+                               $this->getVar( 'wgDBprefix' )
+                       );
+                       $status->value = $this->db;
+               } catch ( DBConnectionError $e ) {
+                       $status->fatal( 'config-connection-error', $e->getMessage() );
+               }
+               return $status;
        }
 
        public function setupDatabase() {