On 8/29/14, Seb35 <[email protected]> wrote:
> Hello,
>
> Sometimes in LocalSettings.php or in extensions settings one want to do
> simple computations on the namespaces or related to the Git branch in a
> development environment. Unfortunately this is not (resp. no more) really
> possible, because LocalSettings.php is loaded before GlobalFunctions.php and
> Setup.php.
>
> Is it a good practice to do that? If yes, is it possible to either:
> * "tag" some static functions in some classes to avoid these to include
> hooks and other global functions and variables (loaded later), and/or
> * move before (in loading order) some global functions and variables to make
> them usable (e.g. wfDebugLog, wfRunHooks, $wgCanonicalNamespaceNames)
> ?
>
>
> Details for namespaces: $wgCanonicalNamespaceNames is defined in Setup.php,
> making MWNamespace::getCanonicalNamespaces() and
> MWNamespace::getValidNamespaces() unusable in LocalSettings.php to e.g.
> compute namespaces where an extension could be enabled
> <https://github.com/mementoweb/mediawiki/pull/2>.
>
> Details for Git version: until two months it worked, but some wfDebugLog was
> introduced (defined in GlobalFunctions.php), making it unusable in
> LocalSettings.php.
>
> ~ Seb35 [^_^]
>
> _______________________________________________
> Wikitech-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

If you need to do something like that, you should probably make a
callback function, and add that to $wgExtensionFunctions.

--bawolff

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to