X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fupdate.php;h=b6c7ae473b1861e4b4f58e30b53dcbe5edfbdc2f;hb=af7ae6c804be8629fe2305e3a088f03e1af2fa9b;hp=2a1feb4603357c318699215d032c1b5e7d81793e;hpb=690f563edc1c85a1ce0b07e3c2a6b61bb21cea46;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/update.php b/maintenance/update.php index 2a1feb4603..b6c7ae473b 100755 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -64,7 +64,7 @@ class UpdateMediaWiki extends Maintenance { function compatChecks() { $minimumPcreVersion = Installer::MINIMUM_PCRE_VERSION; - list( $pcreVersion ) = explode( ' ', PCRE_VERSION, 2 ); + $pcreVersion = explode( ' ', PCRE_VERSION, 2 )[0]; if ( version_compare( $pcreVersion, $minimumPcreVersion, '<' ) ) { $this->fatalError( "PCRE $minimumPcreVersion or later is required.\n" . @@ -242,6 +242,24 @@ class UpdateMediaWiki extends Maintenance { 'manualRecache' => false, ]; } + + public function validateParamsAndArgs() { + // Allow extensions to add additional params. + $params = []; + Hooks::run( 'MaintenanceUpdateAddParams', [ &$params ] ); + foreach ( $params as $name => $param ) { + $this->addOption( + $name, + $param['desc'], + $param['require'] ?? false, + $param['withArg'] ?? false, + $param['shortName'] ?? false, + $param['multiOccurrence'] ?? false + ); + } + + parent::validateParamsAndArgs(); + } } $maintClass = UpdateMediaWiki::class;