00001 <?php
00002
00007 class ForeignDBViaLBRepo extends LocalRepo {
00008 var $wiki, $dbName, $tablePrefix;
00009 var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
00010 var $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
00011
00012 function __construct( $info ) {
00013 parent::__construct( $info );
00014 $this->wiki = $info['wiki'];
00015 list( $this->dbName, $this->tablePrefix ) = wfSplitWikiID( $this->wiki );
00016 $this->hasSharedCache = $info['hasSharedCache'];
00017 }
00018
00019 function getMasterDB() {
00020 return wfGetDB( DB_MASTER, array(), $this->wiki );
00021 }
00022
00023 function getSlaveDB() {
00024 return wfGetDB( DB_SLAVE, array(), $this->wiki );
00025 }
00026 function hasSharedCache() {
00027 return $this->hasSharedCache;
00028 }
00029
00030 function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
00031 throw new MWException( get_class($this) . ': write operations are not supported' );
00032 }
00033 function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
00034 throw new MWException( get_class($this) . ': write operations are not supported' );
00035 }
00036 function deleteBatch( $fileMap ) {
00037 throw new MWException( get_class($this) . ': write operations are not supported' );
00038 }
00039 }