Removed print and render actions from the check:
[mediawiki.git] / includes / filerepo / ForeignDBViaLBRepo.php
blob4c530b511d3e5ee9ce221321496e537e14dd4536
1 <?php
2 /**
3 * A foreign repository with a MediaWiki database accessible via the configured LBFactory
5 * @file
6 * @ingroup FileRepo
7 */
9 /**
10 * A foreign repository with a MediaWiki database accessible via the configured LBFactory
12 * @ingroup FileRepo
14 class ForeignDBViaLBRepo extends LocalRepo {
15 var $wiki, $dbName, $tablePrefix;
16 var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
17 var $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
19 function __construct( $info ) {
20 parent::__construct( $info );
21 $this->wiki = $info['wiki'];
22 list( $this->dbName, $this->tablePrefix ) = wfSplitWikiID( $this->wiki );
23 $this->hasSharedCache = $info['hasSharedCache'];
26 function getMasterDB() {
27 return wfGetDB( DB_MASTER, array(), $this->wiki );
30 function getSlaveDB() {
31 return wfGetDB( DB_SLAVE, array(), $this->wiki );
33 function hasSharedCache() {
34 return $this->hasSharedCache;
37 /**
38 * Get a key on the primary cache for this repository.
39 * Returns false if the repository's cache is not accessible at this site.
40 * The parameters are the parts of the key, as for wfMemcKey().
42 function getSharedCacheKey( /*...*/ ) {
43 if ( $this->hasSharedCache() ) {
44 $args = func_get_args();
45 array_unshift( $args, $this->wiki );
46 return implode( ':', $args );
47 } else {
48 return false;
52 function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
53 throw new MWException( get_class($this) . ': write operations are not supported' );
55 function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
56 throw new MWException( get_class($this) . ': write operations are not supported' );
58 function deleteBatch( $fileMap ) {
59 throw new MWException( get_class($this) . ': write operations are not supported' );