Last modified: 2014-10-17 03:30:36 UTC
Please declare all globals used or created in Validator.php. When Validator is included within a function rather than at file-scope, then the globals are not being created/referenced correctly. Here's what I added to my version .5 Validator.php to make it work in a wikifarm: global $wgAPIListModules, $wgAPIModules, $wgActions, $wgAjaxExportList, $wgAutoloadClasses, $wgAvailableRights, $wgDefaultUserOptions, $wgEditPageFrameOptions, $wgExtensionAliasesFiles, $wgExtensionAssetsFullPath, $wgExtensionAssetsPath, $wgExtensionCredits, $wgExtensionFunctions, $wgExtensionMessagesFiles, $wgExtraNamespaces, $wgGroupPermissions, $wgHooks, $wgJobClasses, $wgLanguageCode, $wgLogActions, $wgLogHeaders, $wgLogNames, $wgLogTypes, $wgNamespacesWithSubpages, $wgParserTestFiles, $wgReservedUsernames, $wgResourceModules, $wgSpecialPageGroups, $wgSpecialPages, $wgVersion, $useJQuery, $useJQuery, $wgContentNamespaces ; global $egValidatorSettings, $egParamDefinitions; I'd agree that it's not a great thing to declare globals that aren't used so you may refine this as appropriate to Validator. Thanks - john
I agree explicitly listing the things so inclusion via some non global scope works. And I'd even go further in saying that ideally the extension does not include the stuff in global scope so no garbage can be left behind. The list you are providing contains many globals not in use by this extension, much less in the entry point, which is the only relevant code.
Also note that the current initialization file is ParamProcessor.php.
Hi Jeroen - I don't see ParamProcessor.php - where is that I want to be sure I've got all the globals covered at my end, and I agree with you that unreferenced globals ought to be removed. Thanks!
It is in the extension root. On master. Not in the latest release.