4 * A foreign repository with a MediaWiki database accessible via the configured LBFactory
7 class ForeignDBViaLBRepo
extends LocalRepo
{
8 var $wiki, $dbName, $tablePrefix;
9 var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
11 function __construct( $info ) {
12 parent
::__construct( $info );
13 $this->wiki
= $info['wiki'];
14 list( $this->dbName
, $this->tablePrefix
) = wfSplitWikiID( $this->wiki
);
15 $this->hasSharedCache
= $info['hasSharedCache'];
18 function getMasterDB() {
19 return wfGetDB( DB_MASTER
, array(), $this->wiki
);
22 function getSlaveDB() {
23 return wfGetDB( DB_SLAVE
, array(), $this->wiki
);
25 function hasSharedCache() {
26 return $this->hasSharedCache
;
29 function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
30 throw new MWException( get_class($this) . ': write operations are not supported' );
32 function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
33 throw new MWException( get_class($this) . ': write operations are not supported' );
35 function deleteBatch( $fileMap ) {
36 throw new MWException( get_class($this) . ': write operations are not supported' );