From: David McCabe Date: Tue, 11 Nov 2008 01:49:38 +0000 (+0000) Subject: Renamed the new wfInvokeFancyCallback to simply wfInvoke. X-Git-Tag: 1.31.0-rc.0~44378 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=17ebdb72f10c08cfcaaffcd28322205e74777838;p=lhc%2Fweb%2Fwiklou.git Renamed the new wfInvokeFancyCallback to simply wfInvoke. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 89b921535f..e505cbdbb3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -202,7 +202,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 15835) Added Content-Style-Type meta tag * Add class="disambiguationpage" to tag for disambiguations * (bug 11027) Add parameter to MW:Randompage-nopages so that user can see the namespace. -* New global function wfInvokeFancyCallback() can be used to dynamically +* New global function wfInvoke() can be used to dynamically invoke functions with a flexible interface, like wfRunHooks does. === Bug fixes in 1.14 === diff --git a/includes/Hooks.php b/includes/Hooks.php index 0a4b03a795..e4404b0a73 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -23,7 +23,7 @@ */ /* Private */ -function _wfInternalFancyCallbackGoop($hook) { +function _wfInvokeInternalGoop($hook) { $object = NULL; $method = NULL; $func = NULL; @@ -76,8 +76,8 @@ function _wfInternalFancyCallbackGoop($hook) { } /* Return a string describing the hook for debugging purposes. */ -function wfFormatFancyCallback($hook) { - list($callback, $func, $data) = _wfInternalFancyCallbackGoop($hook, $args); +function wfFormatInvocation($hook) { + list($callback, $func, $data) = _wfInvokeInternalGoop($hook, $args); if( is_array( $callback ) ) { if( is_object( $callback[0] ) ) { @@ -101,8 +101,8 @@ function wfFormatFancyCallback($hook) { * If arguments are provided both as part of the hook itself, and when * calling wfCallFancyCallback, the two arrays are merged. */ -function wfInvokeFancyCallback($hook, $args = array()) { - list($callback, $func, $data) = _wfInternalFancyCallbackGoop($hook, $args); +function wfInvoke($hook, $args = array()) { + list($callback, $func, $data) = _wfInvokeInternalGoop($hook, $args); /* We put the first data element on, if needed. */ if ($data) { @@ -147,7 +147,7 @@ function wfRunHooks($event, $args = array()) { foreach ($wgHooks[$event] as $index => $hook) { - $retval = wfInvokeFancyCallback($hook, $args); + $retval = wfInvoke($hook, $args); /* String return is an error; false return means stop processing. */ @@ -156,7 +156,7 @@ function wfRunHooks($event, $args = array()) { $wgOut->showFatalError($retval); return false; } elseif( $retval === null ) { - $prettyFunc = wfFormatFancyCallback($hook); + $prettyFunc = wfFormatInvocation($hook); throw new MWException( "Detected bug in an extension! " . "Hook $prettyFunc failed to return a value; " . "should return true to continue hook processing or false to abort." );