Page MenuHomePhabricator

Don't use a closure in $wgExtensionFunctions
Closed, ResolvedPublic

Description

As Special:Version then outputs it as "(Closure)" which is silly


Version: unspecified
Severity: trivial

Details

Reference
bz45167

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:39 AM
bzimport set Reference to bz45167.
Reedy created this task.Feb 19 2013, 7:21 PM

Gerrit change 49854

Merged by Aude.

Verified in Wikidata demp sprint 33

aude added a comment.Feb 24 2013, 5:46 AM

https://gerrit.wikimedia.org/r/#/c/50493/

I don't like the global function, but reintroducing the issue is not great either.

Isn't there some better approach here?

Maybe introduce a new usage?

$wgExtensionFunctions[] = array(

'func' => function() { /* ... */ },
'name' => 'Some descriptive name',

);

I do not see how the feature we are trying to support here is useful at all. I have never any any use for it, and don't know of someone who did. Why display this random list of functions there? If it was one per extension, and it was the main entry point for these extensions, then I could see some use. This is however not the case. Many extensions don't have a handler for this hook, some have multiple handlers, and in our case, the handler we have is for some feature that is certainly not worth mentioning on Special:Version. If it was, we'd also want to list a lot of other things.

https://gerrit.wikimedia.org/r/#/c/71355/

Change 71972 had a related patch set uploaded by Daniel Kinzler:
(bug 45167) use SetupAfterCache to register templates.

https://gerrit.wikimedia.org/r/71972

Change 71972 merged by jenkins-bot:
(bug 45167) use SetupAfterCache to register templates.

https://gerrit.wikimedia.org/r/71972

Change 71355 had a related patch set uploaded by Krinkle:
Remove list of functions added in wgExtensionFunctions

https://gerrit.wikimedia.org/r/71355

Change 71355 merged by jenkins-bot:
Remove list of functions added in wgExtensionFunctions

https://gerrit.wikimedia.org/r/71355

Verified in Wikidata demo time July 17th