$wgSpecialPageGroups is deprecated since 1.21
The code should be migrated to override SpecialPage::getGroupName before
adding an extension.json to the extension, instead of allowing setting
this over extension.json
Also added a warning to convertExtensionToRegistration.php for the no
longer supported global
Change-Id: Idccbe41b649de93548c5b0fca03145da716bcc65
"type": "object",
"description": "SpecialPages implemented in this extension (mapping of page name to class name)"
},
"type": "object",
"description": "SpecialPages implemented in this extension (mapping of page name to class name)"
},
- "SpecialPageGroups": {
- "type": "object",
- "description": "Mapping of special page name to group it belongs to"
- },
"AutoloadClasses": {
"type": "object"
},
"AutoloadClasses": {
"type": "object"
},
'ExtensionFunctions',
'ExtensionEntryPointListFiles',
'SpecialPages',
'ExtensionFunctions',
'ExtensionEntryPointListFiles',
'SpecialPages',
'JobClasses',
'LogTypes',
'LogRestrictions',
'JobClasses',
'LogTypes',
'LogRestrictions',
+ /**
+ * No longer supported globals (with reason) should not be converted and emit a warning
+ *
+ * @var array
+ */
+ protected $noLongerSupportedGlobals = array(
+ 'SpecialPageGroups' => 'deprecated',
+ );
+
/**
* Keys that should be put at the top of the generated JSON file (T86608)
*
/**
* Keys that should be put at the top of the generated JSON file (T86608)
*
+ private $json, $dir, $hasWarning = false;
public function __construct() {
parent::__construct();
public function __construct() {
parent::__construct();
call_user_func_array( array( $this, $this->custom[$realName] ), array( $realName, $value, $vars ) );
} elseif ( in_array( $realName, $globalSettings ) ) {
$this->json[$realName] = $value;
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 ) ) {
+ $this->output( 'Warning: Skipped global "' . $name . '" (' .
+ $this->noLongerSupportedGlobals[$realName] . '). ' .
+ "Please update the entry point before convert to registration.\n" );
+ $this->hasWarning = true;
} elseif ( strpos( $name, 'wg' ) === 0 ) {
// Most likely a config setting
$this->json['config'][$realName] = $value;
} elseif ( strpos( $name, 'wg' ) === 0 ) {
// Most likely a config setting
$this->json['config'][$realName] = $value;
$prettyJSON = FormatJson::encode( $out, "\t", FormatJson::ALL_OK );
file_put_contents( $fname, $prettyJSON . "\n" );
$this->output( "Wrote output to $fname.\n" );
$prettyJSON = FormatJson::encode( $out, "\t", FormatJson::ALL_OK );
file_put_contents( $fname, $prettyJSON . "\n" );
$this->output( "Wrote output to $fname.\n" );
+ if ( $this->hasWarning ) {
+ $this->output( "Found warnings! Please resolve the warnings and rerun this script.\n" );
+ }
}
protected function handleExtensionFunctions( $realName, $value ) {
}
protected function handleExtensionFunctions( $realName, $value ) {