Last modified: 2009-04-06 12:41:46 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 T20009, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18009 - "closure" callables not supported
"closure" callables not supported
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.15.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: newphp
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-16 20:18 UTC by Jack Bates
Modified: 2009-04-06 12:41 UTC (History)
1 user (show)

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


Attachments

Description Jack Bates 2009-03-16 20:18:30 UTC
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 />
Comment 1 Alexandre Emsenhuber [IAlex] 2009-04-06 12:41:46 UTC
fixed in r49243.

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


Navigation
Links