Last modified: 2014-10-17 03:30:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49098, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47098 - unspecified globals
unspecified globals
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
Validator (Other open bugs)
unspecified
All All
: Lowest normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-10 20:07 UTC by John McClure
Modified: 2014-10-17 03:30 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John McClure 2013-04-10 20:07:47 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
Comment 1 Jeroen De Dauw 2013-04-11 09:53:47 UTC
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.
Comment 2 Jeroen De Dauw 2013-04-11 09:54:30 UTC
Also note that the current initialization file is ParamProcessor.php.
Comment 3 John McClure 2013-04-11 14:24:55 UTC
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!
Comment 4 Jeroen De Dauw 2013-04-11 14:26:08 UTC
It is in the extension root. On master. Not in the latest release.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links