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" .
$this->output( "MediaWiki {$wgVersion} Updater\n\n" );
+ foreach ( SpecialVersion::getSoftwareInformation() as $name => $version ) {
+ $this->output( "{$name}: {$version}\n" );
+ }
+
wfWaitForSlaves();
if ( !$this->hasOption( 'skip-compat-checks' ) ) {
'manualRecache' => false,
];
}
+
+ /**
+ * @throws FatalError
+ * @throws MWException
+ * @suppress PhanPluginDuplicateConditionalNullCoalescing
+ */
+ public function validateParamsAndArgs() {
+ // Allow extensions to add additional params.
+ $params = [];
+ Hooks::run( 'MaintenanceUpdateAddParams', [ &$params ] );
+
+ // This executes before the PHP version check, so don't use null coalesce (??).
+ // Keeping this compatible with older PHP versions lets us reach the code that
+ // displays a more helpful error.
+ foreach ( $params as $name => $param ) {
+ $this->addOption(
+ $name,
+ $param['desc'],
+ isset( $param['require'] ) ? $param['require'] : false,
+ isset( $param['withArg'] ) ? $param['withArg'] : false,
+ isset( $param['shortName'] ) ? $param['shortName'] : false,
+ isset( $param['multiOccurrence'] ) ? $param['multiOccurrence'] : false
+ );
+ }
+
+ parent::validateParamsAndArgs();
+ }
}
$maintClass = UpdateMediaWiki::class;