protected $tablePrefix;
/** @var array */
- protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
+ protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ];
/** @var array */
- protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+ protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ];
+
+ /** @var bool */
+ protected $hasSharedCache;
/**
* @param array|null $info
}
/**
- * @return DatabaseBase
+ * @return IDatabase
*/
function getMasterDB() {
- return wfGetDB( DB_MASTER, array(), $this->wiki );
+ return wfGetLB( $this->wiki )->getConnectionRef( DB_MASTER, [], $this->wiki );
}
/**
- * @return DatabaseBase
+ * @return IDatabase
*/
function getSlaveDB() {
- return wfGetDB( DB_SLAVE, array(), $this->wiki );
+ return wfGetLB( $this->wiki )->getConnectionRef( DB_REPLICA, [], $this->wiki );
+ }
+
+ /**
+ * @return Closure
+ */
+ protected function getDBFactory() {
+ return function( $index ) {
+ return wfGetLB( $this->wiki )->getConnectionRef( $index, [], $this->wiki );
+ };
}
function hasSharedCache() {
protected function assertWritableRepo() {
throw new MWException( get_class( $this ) . ': write operations are not supported.' );
}
+
+ public function getInfo() {
+ return FileRepo::getInfo();
+ }
}