Merge "Avoid bogus IE extension check errors in img_auth.php"
[lhc/web/wiklou.git] / includes / filerepo / ForeignDBViaLBRepo.php
index 2132ba6..8153ffb 100644 (file)
  * @ingroup FileRepo
  */
 class ForeignDBViaLBRepo extends LocalRepo {
-       var $wiki, $dbName, $tablePrefix;
-       var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
-       var $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+       /** @var string */
+       protected $wiki;
 
+       /** @var string */
+       protected $dbName;
+
+       /** @var string */
+       protected $tablePrefix;
+
+       /** @var array */
+       protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
+
+       /** @var array */
+       protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+
+       /**
+        * @param array|null $info
+        */
        function __construct( $info ) {
                parent::__construct( $info );
                $this->wiki = $info['wiki'];
@@ -38,10 +52,16 @@ class ForeignDBViaLBRepo extends LocalRepo {
                $this->hasSharedCache = $info['hasSharedCache'];
        }
 
+       /**
+        * @return DatabaseBase
+        */
        function getMasterDB() {
                return wfGetDB( DB_MASTER, array(), $this->wiki );
        }
 
+       /**
+        * @return DatabaseBase
+        */
        function getSlaveDB() {
                return wfGetDB( DB_SLAVE, array(), $this->wiki );
        }
@@ -52,7 +72,7 @@ class ForeignDBViaLBRepo extends LocalRepo {
 
        /**
         * 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|string
         */
@@ -60,6 +80,7 @@ class ForeignDBViaLBRepo extends LocalRepo {
                if ( $this->hasSharedCache() ) {
                        $args = func_get_args();
                        array_unshift( $args, $this->wiki );
+
                        return implode( ':', $args );
                } else {
                        return false;
@@ -69,4 +90,8 @@ class ForeignDBViaLBRepo extends LocalRepo {
        protected function assertWritableRepo() {
                throw new MWException( get_class( $this ) . ': write operations are not supported.' );
        }
+
+       public function getInfo() {
+               return FileRepo::getInfo();
+       }
 }