X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateExtensionJsonSchema.php;h=a27c8a517f9d66ba5754af850d3686808b63e412;hb=f51c9e889f24091d3e20488530c1f80900059868;hp=427769f19f1a164aa18d69eefd926607ec7b08ab;hpb=bb8608c98a3d677d8557dd7056a7434c7c38c055;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateExtensionJsonSchema.php b/maintenance/updateExtensionJsonSchema.php index 427769f19f..a27c8a517f 100644 --- a/maintenance/updateExtensionJsonSchema.php +++ b/maintenance/updateExtensionJsonSchema.php @@ -14,12 +14,12 @@ class UpdateExtensionJsonSchema extends Maintenance { public function execute() { $filename = $this->getArg( 0 ); if ( !is_readable( $filename ) ) { - $this->error( "Error: Unable to read $filename", 1 ); + $this->fatalError( "Error: Unable to read $filename" ); } $json = FormatJson::decode( file_get_contents( $filename ), true ); if ( $json === null ) { - $this->error( "Error: Invalid JSON", 1 ); + $this->fatalError( "Error: Invalid JSON" ); } if ( !isset( $json['manifest_version'] ) ) { @@ -59,11 +59,18 @@ class UpdateExtensionJsonSchema extends Maintenance { $json['config'][$name]['merge_strategy'] = $value[ExtensionRegistry::MERGE_STRATEGY]; unset( $value[ExtensionRegistry::MERGE_STRATEGY] ); } + if ( isset( $config["@$name"] ) ) { + // Put 'description' first for better human-legibility. + $json['config'][$name] = array_merge( + [ 'description' => $config["@$name"] ], + $json['config'][$name] + ); + } } } } } } -$maintClass = 'UpdateExtensionJsonSchema'; +$maintClass = UpdateExtensionJsonSchema::class; require_once RUN_MAINTENANCE_IF_MAIN;