r43379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43378‎ | r43379 | r43380 >
Date:01:49, 11 November 2008
Author:david
Status:old (Comments)
Tags:
Comment:
Renamed the new wfInvokeFancyCallback to simply wfInvoke.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Hooks.php
@@ -23,7 +23,7 @@
2424 */
2525
2626 /* Private */
27 -function _wfInternalFancyCallbackGoop($hook) {
 27+function _wfInvokeInternalGoop($hook) {
2828 $object = NULL;
2929 $method = NULL;
3030 $func = NULL;
@@ -76,8 +76,8 @@
7777 }
7878
7979 /* Return a string describing the hook for debugging purposes. */
80 -function wfFormatFancyCallback($hook) {
81 - list($callback, $func, $data) = _wfInternalFancyCallbackGoop($hook, $args);
 80+function wfFormatInvocation($hook) {
 81+ list($callback, $func, $data) = _wfInvokeInternalGoop($hook, $args);
8282
8383 if( is_array( $callback ) ) {
8484 if( is_object( $callback[0] ) ) {
@@ -101,8 +101,8 @@
102102 * If arguments are provided both as part of the hook itself, and when
103103 * calling wfCallFancyCallback, the two arrays are merged.
104104 */
105 -function wfInvokeFancyCallback($hook, $args = array()) {
106 - list($callback, $func, $data) = _wfInternalFancyCallbackGoop($hook, $args);
 105+function wfInvoke($hook, $args = array()) {
 106+ list($callback, $func, $data) = _wfInvokeInternalGoop($hook, $args);
107107
108108 /* We put the first data element on, if needed. */
109109 if ($data) {
@@ -147,7 +147,7 @@
148148
149149 foreach ($wgHooks[$event] as $index => $hook) {
150150
151 - $retval = wfInvokeFancyCallback($hook, $args);
 151+ $retval = wfInvoke($hook, $args);
152152
153153 /* String return is an error; false return means stop processing. */
154154
@@ -156,7 +156,7 @@
157157 $wgOut->showFatalError($retval);
158158 return false;
159159 } elseif( $retval === null ) {
160 - $prettyFunc = wfFormatFancyCallback($hook);
 160+ $prettyFunc = wfFormatInvocation($hook);
161161 throw new MWException( "Detected bug in an extension! " .
162162 "Hook $prettyFunc failed to return a value; " .
163163 "should return true to continue hook processing or false to abort." );
Index: trunk/phase3/RELEASE-NOTES
@@ -202,7 +202,7 @@
203203 * (bug 15835) Added Content-Style-Type meta tag
204204 * Add class="disambiguationpage" to <body> tag for disambiguations
205205 * (bug 11027) Add parameter to MW:Randompage-nopages so that user can see the namespace.
206 -* New global function wfInvokeFancyCallback() can be used to dynamically
 206+* New global function wfInvoke() can be used to dynamically
207207 invoke functions with a flexible interface, like wfRunHooks does.
208208
209209 === Bug fixes in 1.14 ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r43383Remove RELEASE-NOTES entry added in r43377 (Factored wfInvokeFancyCallback() ...catrope13:27, 11 November 2008
r43416Roll back r43377, r43379 "Factored wfInvokeFancyCallback() out of wfRunHooks(...brion18:06, 12 November 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   18:07, 12 November 2008

Reverted in r43416 along with r43377

Status & tagging log