Added some __METHOD__ to DatabaseBase::query() calls
[lhc/web/wiklou.git] / includes / installer / OracleInstaller.php
index ba3a5ca..84d89f5 100644 (file)
@@ -1,6 +1,18 @@
 <?php
-
-class OracleInstaller extends InstallerDBType {
+/**
+ * Oracle-specific installer.
+ *
+ * @file
+ * @ingroup Deployment
+ */
+/**
+ * Class for setting up the MediaWiki database using Oracle.
+ * 
+ * @ingroup Deployment
+ * @since 1.17
+ */
+class OracleInstaller extends DatabaseInstaller {
 
        protected $globalNames = array(
                'wgDBport',
@@ -15,7 +27,7 @@ class OracleInstaller extends InstallerDBType {
                '_InstallPassword' => '',
        );
 
-       function getName() {
+       public function getName() {
                return 'oracle';
        }
 
@@ -23,7 +35,7 @@ class OracleInstaller extends InstallerDBType {
                return self::checkExtension( 'oci8' );
        }
 
-       function getConnectForm() {
+       public function getConnectForm() {
                return
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
@@ -35,7 +47,7 @@ class OracleInstaller extends InstallerDBType {
                        $this->getInstallUserBox();
        }
 
-       function submitConnectForm() {
+       public function submitConnectForm() {
                // Get variables from the request
                $newValues = $this->setVarsFromRequest( array( 'wgDBname', 'wgDBprefix' ) );
 
@@ -76,21 +88,38 @@ class OracleInstaller extends InstallerDBType {
                return $status;
        }
 
+       public function getConnection() {
+               $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;
+       }
 
-       function getSettingsForm() {}
-       
-       function submitSettingsForm() {}
-
-       function getConnection() {}
-
-       function setupDatabase() {}
-
-       function createTables() {}
+       public function setupDatabase() {
+               // TODO
+       }
 
-       function getLocalSettings() {
+       public function getLocalSettings() {
                $prefix = $this->getVar( 'wgDBprefix' );
                return
 "# Oracle specific settings
 \$wgDBprefix         = \"{$prefix}\";";
        }
-}
+
+       public function doUpgrade() {
+               // TODO
+               return false;
+       }
+}
\ No newline at end of file