* @ingroup FileRepo
*/
+use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
+
/**
* A foreign repository with an accessible MediaWiki database
*
/** @var bool */
protected $hasSharedCache;
- # Other stuff
+ /** @var IDatabase */
protected $dbConn;
- protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
- protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+
+ /** @var callable */
+ protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ];
+ /** @var callable */
+ protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ];
/**
* @param array|null $info
/**
* @return IDatabase
*/
- function getSlaveDB() {
+ function getReplicaDB() {
return $this->getMasterDB();
}
*/
protected function getDBFactory() {
$type = $this->dbType;
- $params = array(
+ $params = [
'host' => $this->dbServer,
'user' => $this->dbUser,
'password' => $this->dbPassword,
'flags' => $this->dbFlags,
'tablePrefix' => $this->tablePrefix,
'foreign' => true,
- );
+ ];
return function ( $index ) use ( $type, $params ) {
- return DatabaseBase::factory( $type, $params );
+ return Database::factory( $type, $params );
};
}
}
protected function assertWritableRepo() {
- throw new MWException( get_class( $this ) . ': write operations are not supported.' );
+ throw new MWException( static::class . ': write operations are not supported.' );
}
/**