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 newFileFromRow( $row ) {
12 if ( isset( $row->img_name
) )
13 return ForeignDBFile
::newFromRow( $row, $this );
14 return parent
::newFileFromRow( $row );
17 function __construct( $info ) {
18 parent
::__construct( $info );
19 $this->wiki
= $info['wiki'];
20 list( $this->dbName
, $this->tablePrefix
) = wfSplitWikiID( $this->wiki
);
21 $this->hasSharedCache
= $info['hasSharedCache'];
24 function getMasterDB() {
25 return wfGetDB( DB_MASTER
, array(), $this->wiki
);
28 function getSlaveDB() {
29 return wfGetDB( DB_SLAVE
, array(), $this->wiki
);
31 function hasSharedCache() {
32 return $this->hasSharedCache
;
35 function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
36 throw new MWException( get_class($this) . ': write operations are not supported' );
38 function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
39 throw new MWException( get_class($this) . ': write operations are not supported' );
41 function deleteBatch( $fileMap ) {
42 throw new MWException( get_class($this) . ': write operations are not supported' );