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' );
10 var $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
12 function __construct( $info ) {
13 parent
::__construct( $info );
14 $this->wiki
= $info['wiki'];
15 list( $this->dbName
, $this->tablePrefix
) = wfSplitWikiID( $this->wiki
);
16 $this->hasSharedCache
= $info['hasSharedCache'];
19 function getMasterDB() {
20 return wfGetDB( DB_MASTER
, array(), $this->wiki
);
23 function getSlaveDB() {
24 return wfGetDB( DB_SLAVE
, array(), $this->wiki
);
26 function hasSharedCache() {
27 return $this->hasSharedCache
;
30 function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
31 throw new MWException( get_class($this) . ': write operations are not supported' );
33 function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
34 throw new MWException( get_class($this) . ': write operations are not supported' );
36 function deleteBatch( $fileMap ) {
37 throw new MWException( get_class($this) . ': write operations are not supported' );