X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertExtensionToRegistration.php;h=3e86d8a6d827560713dcc8bc69c909b12572e32a;hb=25bb740e50d5f4f967e80f5d6a373405e5ef187a;hp=e0631a721d8af95e240a754f4a6cd34a9615668e;hpb=5bb693f6d4551623dfbb3ba7bf6060a3ce5106b1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index e0631a721d..3e86d8a6d8 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -31,7 +31,7 @@ class ConvertExtensionToRegistration extends Maintenance { * @var array */ protected $noLongerSupportedGlobals = array( - 'SpecialPageGroups' => 'deprecated', + 'SpecialPageGroups' => 'deprecated', // Deprecated 1.21, removed in 1.26 ); /** @@ -56,7 +56,8 @@ class ConvertExtensionToRegistration extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = 'Converts extension entry points to the new JSON registration format'; - $this->addArg( 'path', 'Location to the PHP entry point you wish to convert', /* $required = */ true ); + $this->addArg( 'path', 'Location to the PHP entry point you wish to convert', + /* $required = */ true ); $this->addOption( 'skin', 'Whether to write to skin.json', false, false ); } @@ -95,7 +96,8 @@ class ConvertExtensionToRegistration extends Maintenance { } if ( isset( $this->custom[$realName] ) ) { - call_user_func_array( array( $this, $this->custom[$realName] ), array( $realName, $value, $vars ) ); + call_user_func_array( array( $this, $this->custom[$realName] ), + array( $realName, $value, $vars ) ); } elseif ( in_array( $realName, $globalSettings ) ) { $this->json[$realName] = $value; } elseif ( array_key_exists( $realName, $this->noLongerSupportedGlobals ) ) { @@ -118,7 +120,8 @@ class ConvertExtensionToRegistration extends Maintenance { } } $out += $this->json; - + // Put this at the bottom + $out['manifest_version'] = ExtensionRegistry::MANIFEST_VERSION; $type = $this->hasOption( 'skin' ) ? 'skin' : 'extension'; $fname = "{$this->dir}/$type.json"; $prettyJSON = FormatJson::encode( $out, "\t", FormatJson::ALL_OK ); @@ -132,7 +135,9 @@ class ConvertExtensionToRegistration extends Maintenance { protected function handleExtensionFunctions( $realName, $value ) { foreach ( $value as $func ) { if ( $func instanceof Closure ) { - $this->error( "Error: Closures cannot be converted to JSON. Please move your extension function somewhere else.", 1 ); + $this->error( "Error: Closures cannot be converted to JSON. " . + "Please move your extension function somewhere else.", 1 + ); } } @@ -181,7 +186,7 @@ class ConvertExtensionToRegistration extends Maintenance { $this->json[$realName] = $out; } - protected function handleCredits( $realName, $value) { + protected function handleCredits( $realName, $value ) { $keys = array_keys( $value ); $this->json['type'] = $keys[0]; $values = array_values( $value ); @@ -196,7 +201,9 @@ class ConvertExtensionToRegistration extends Maintenance { foreach ( $value as $hookName => $handlers ) { foreach ( $handlers as $func ) { if ( $func instanceof Closure ) { - $this->error( "Error: Closures cannot be converted to JSON. Please move the handler for $hookName somewhere else.", 1 ); + $this->error( "Error: Closures cannot be converted to JSON. " . + "Please move the handler for $hookName somewhere else.", 1 + ); } } } @@ -228,7 +235,6 @@ class ConvertExtensionToRegistration extends Maintenance { } } - $this->json[$realName][$name] = $data; } if ( $defaults ) {