* @file
* @ingroup Deployment
*/
-use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
/**
* Handle to the database subclass
*
- * @var Database
+ * @var IMaintainableDatabase
*/
protected $db;
protected $holdContentHandlerUseDB = true;
/**
- * @param Database &$db To perform updates on
+ * @param IMaintainableDatabase &$db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
* @param Maintenance|null $maintenance Maintenance object which created us
*/
- protected function __construct( Database &$db, $shared, Maintenance $maintenance = null ) {
+ protected function __construct(
+ IMaintainableDatabase &$db,
+ $shared,
+ Maintenance $maintenance = null
+ ) {
$this->db = $db;
$this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
$this->shared = $shared;
}
/**
- * @param Database $db
+ * @param IMaintainableDatabase $db
* @param bool $shared
* @param Maintenance|null $maintenance
*
* @throws MWException
* @return DatabaseUpdater
*/
- public static function newForDB( Database $db, $shared = false, Maintenance $maintenance = null ) {
+ public static function newForDB(
+ IMaintainableDatabase $db,
+ $shared = false,
+ Maintenance $maintenance = null
+ ) {
$type = $db->getType();
if ( in_array( $type, Installer::getDBTypes() ) ) {
$class = ucfirst( $type ) . 'Updater';
/**
* Get a database connection to run updates
*
- * @return Database
+ * @return IMaintainableDatabase
*/
public function getDB() {
return $this->db;
if ( $val && $this->canUseNewUpdatelog() ) {
$values['ul_value'] = $val;
}
- $this->db->insert( 'updatelog', $values, __METHOD__, 'IGNORE' );
+ $this->db->insert( 'updatelog', $values, __METHOD__, [ 'IGNORE' ] );
$this->db->setFlag( DBO_DDLMODE );
}
*/
protected function rebuildLocalisationCache() {
/**
- * @var $cl RebuildLocalisationCache
+ * @var RebuildLocalisationCache $cl
*/
$cl = $this->maintenance->runChild(
RebuildLocalisationCache::class, 'rebuildLocalisationCache.php'