Have maintenance/updateExtensionJsonSchema.php copy documentation
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 16 Oct 2018 15:12:43 +0000 (11:12 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 16 Oct 2018 15:30:30 +0000 (11:30 -0400)
It already skips version-1 style documentation keys that begin with "@".
It should also copy them into the "description" metadata key for
version 2.

Change-Id: I460568f074b9c0256eb6bbbcd0b046b16e0d8790

maintenance/updateExtensionJsonSchema.php

index 6233d5b..a27c8a5 100644 (file)
@@ -59,6 +59,13 @@ 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]
+                                               );
+                                       }
                                }
                        }
                }