X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FForeignDBViaLBRepo.php;h=2132ba6d2f51991045fe77ac9448c65ad9e7be31;hb=a350d68e093ee50ad1e86b24a8afb776d722cab7;hp=7648c23468a8323b3b257b50cda4b72ce49c2481;hpb=57af2aecb53a4ee5cececbd322266f253e5f7ec6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index 7648c23468..2132ba6d2f 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -1,7 +1,29 @@ img_name ) ) - return ForeignDBFile::newFromRow( $row, $this ); - return parent::newFileFromRow( $row ); - } - function __construct( $info ) { parent::__construct( $info ); $this->wiki = $info['wiki']; @@ -29,17 +45,28 @@ class ForeignDBViaLBRepo extends LocalRepo { function getSlaveDB() { return wfGetDB( DB_SLAVE, array(), $this->wiki ); } + function hasSharedCache() { return $this->hasSharedCache; } - function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) { - throw new MWException( get_class($this) . ': write operations are not supported' ); + /** + * Get a key on the primary cache for this repository. + * 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 + */ + function getSharedCacheKey( /*...*/ ) { + if ( $this->hasSharedCache() ) { + $args = func_get_args(); + array_unshift( $args, $this->wiki ); + return implode( ':', $args ); + } else { + return false; + } } - function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { - throw new MWException( get_class($this) . ': write operations are not supported' ); - } - function deleteBatch( $fileMap ) { - 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.' ); } }