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