]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/filerepo/ForeignDBRepo.php
MediaWiki 1.17.1
[autoinstallsdev/mediawiki.git] / includes / filerepo / ForeignDBRepo.php
index 35c2c4bf114d1646d2d0b9278981a9fb71870658..a756703f34b4b04ec4fb8ceccf61d2413c7478ea 100644 (file)
@@ -1,7 +1,14 @@
 <?php
+/**
+ * A foreign repository with an accessible MediaWiki database
+ *
+ * @file
+ * @ingroup FileRepo
+ */
 
 /**
  * A foreign repository with an accessible MediaWiki database
+ *
  * @ingroup FileRepo
  */
 class ForeignDBRepo extends LocalRepo {
@@ -28,10 +35,16 @@ class ForeignDBRepo extends LocalRepo {
 
        function getMasterDB() {
                if ( !isset( $this->dbConn ) ) {
-                       $class = 'Database' . ucfirst( $this->dbType );
-                       $this->dbConn = new $class( $this->dbServer, $this->dbUser,
-                               $this->dbPassword, $this->dbName, false, $this->dbFlags,
-                               $this->tablePrefix );
+                       $this->dbConn = DatabaseBase::newFromType( $this->dbType,
+                               array(
+                                       'host' => $this->dbServer,
+                                       'user'   => $this->dbUser,
+                                       'password' => $this->dbPassword,
+                                       'dbname' => $this->dbName,
+                                       'flags' => $this->dbFlags,
+                                       'tableprefix' => $this->tablePrefix
+                               )
+                       );
                }
                return $this->dbConn;
        }
@@ -65,7 +78,7 @@ class ForeignDBRepo extends LocalRepo {
        function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
                throw new MWException( get_class($this) . ': write operations are not supported' );
        }
-       function deleteBatch( $fileMap ) {
+       function deleteBatch( $sourceDestPairs ) {
                throw new MWException( get_class($this) . ': write operations are not supported' );
        }
 }