Merge "Allow server selection when running sql.php"
[lhc/web/wiklou.git] / includes / filerepo / ForeignDBRepo.php
index 6a1cfaf..ecad618 100644 (file)
@@ -36,6 +36,9 @@ class ForeignDBRepo extends LocalRepo {
        var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
        var $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
 
+       /**
+        * @param $info array|null
+        */
        function __construct( $info ) {
                parent::__construct( $info );
                $this->dbType = $info['dbType'];
@@ -48,12 +51,15 @@ class ForeignDBRepo extends LocalRepo {
                $this->hasSharedCache = $info['hasSharedCache'];
        }
 
+       /**
+        * @return DatabaseBase
+        */
        function getMasterDB() {
                if ( !isset( $this->dbConn ) ) {
                        $this->dbConn = DatabaseBase::factory( $this->dbType,
                                array(
                                        'host' => $this->dbServer,
-                                       'user'   => $this->dbUser,
+                                       'user' => $this->dbUser,
                                        'password' => $this->dbPassword,
                                        'dbname' => $this->dbName,
                                        'flags' => $this->dbFlags,
@@ -64,17 +70,23 @@ class ForeignDBRepo extends LocalRepo {
                return $this->dbConn;
        }
 
+       /**
+        * @return DatabaseBase
+        */
        function getSlaveDB() {
                return $this->getMasterDB();
        }
 
+       /**
+        * @return bool
+        */
        function hasSharedCache() {
                return $this->hasSharedCache;
        }
 
        /**
         * Get a key on the primary cache for this repository.
-        * Returns false if the repository's cache is not accessible at this site. 
+        * Returns false if the repository's cache is not accessible at this site.
         * The parameters are the parts of the key, as for wfMemcKey().
         * @return bool|mixed
         */