Page MenuHomePhabricator

"closure" callables not supported
Closed, ResolvedPublic

Description

Author: ms419

Description:
I tried taking advantage of PHP 5.3's "closures": http://wiki.php.net/rfc/closures

  • to define a hook in my LocalSettings.php:

[...]
$wgHooks['BeforePageDisplay'][] = function ( &$out, &$sk ) {

$out->addScript( '<script src="autolink.js" type="text/javascript"></script>' );

return true;
};
[...]

However MediaWiki produced the following excetion:

<b>Warning</b>: call_user_func_array() expects parameter 1 to be a valid callback, class 'Closure' does not have a method 'onBeforePageDisplay' in <b>/home/jablko/public_html/mediawiki/includes/Hooks.php</b> on line <b>117</b><br />
MediaWiki internal error.<br />


Version: 1.15.x
Severity: enhancement

Details

Reference
bz18009

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:34 PM
bzimport set Reference to bz18009.
bzimport added a subscriber: Unknown Object (MLST).