X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=8a9cd058716785752042be901af57d12fd26ed83;hb=4051970d03686d0f05516659a35733cd5325eb37;hp=7a92807e0ca4e64786286ba8a55747aad019af4b;hpb=d6e366a318a2fedf88533456b71f91cb5c52c5e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 7a92807e0c..8a9cd05871 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -20,8 +20,8 @@ * @file * @ingroup Deployment */ -use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; +use Wikimedia\Rdbms\IMaintainableDatabase; use MediaWiki\MediaWikiServices; require_once __DIR__ . '/../../maintenance/Maintenance.php'; @@ -59,7 +59,7 @@ abstract class DatabaseUpdater { /** * Handle to the database subclass * - * @var Database + * @var IMaintainableDatabase */ protected $db; @@ -110,11 +110,15 @@ abstract class DatabaseUpdater { 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; @@ -177,14 +181,18 @@ abstract class DatabaseUpdater { } /** - * @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'; @@ -198,7 +206,7 @@ abstract class DatabaseUpdater { /** * Get a database connection to run updates * - * @return Database + * @return IMaintainableDatabase */ public function getDB() { return $this->db; @@ -410,9 +418,8 @@ abstract class DatabaseUpdater { $this->updatesSkipped = []; foreach ( $updates as $funcList ) { - $func = $funcList[0]; - $args = $funcList[1]; - $origParams = $funcList[2]; + list( $func, $args, $origParams ) = $funcList; + // @phan-suppress-next-line PhanUndeclaredInvokeInCallable $func( ...$args ); flush(); $this->updatesSkipped[] = $origParams; @@ -525,7 +532,7 @@ abstract class DatabaseUpdater { 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 ); } @@ -1221,7 +1228,7 @@ abstract class DatabaseUpdater { */ protected function rebuildLocalisationCache() { /** - * @var $cl RebuildLocalisationCache + * @var RebuildLocalisationCache $cl */ $cl = $this->maintenance->runChild( RebuildLocalisationCache::class, 'rebuildLocalisationCache.php'