X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBRepo.php;h=18659852d2c5d88792986e990c9d048e03c2d461;hb=8199d6121aeadb4a6c9c6975b804e3e55e112fd5;hp=a756703f34b4b04ec4fb8ceccf61d2413c7478ea;hpb=3947a80b1c931a9728ed7bf012506539c99e46dd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index a756703f34..18659852d2 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -1,6 +1,21 @@ dbType = $info['dbType']; @@ -33,34 +51,44 @@ class ForeignDBRepo extends LocalRepo { $this->hasSharedCache = $info['hasSharedCache']; } + /** + * @return DatabaseBase + */ function getMasterDB() { if ( !isset( $this->dbConn ) ) { - $this->dbConn = DatabaseBase::newFromType( $this->dbType, + $this->dbConn = DatabaseBase::factory( $this->dbType, array( 'host' => $this->dbServer, 'user' => $this->dbUser, 'password' => $this->dbPassword, 'dbname' => $this->dbName, 'flags' => $this->dbFlags, - 'tableprefix' => $this->tablePrefix + 'tablePrefix' => $this->tablePrefix ) ); } 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 */ function getSharedCacheKey( /*...*/ ) { if ( $this->hasSharedCache() ) { @@ -72,13 +100,7 @@ class ForeignDBRepo extends LocalRepo { } } - function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) { - throw new MWException( get_class($this) . ': write operations are not supported' ); - } - function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { - throw new MWException( get_class($this) . ': write operations are not supported' ); - } - function deleteBatch( $sourceDestPairs ) { - throw new MWException( get_class($this) . ': write operations are not supported' ); + protected function assertWritableRepo() { + throw new MWException( get_class( $this ) . ': write operations are not supported.' ); } }