r14767 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14766‎ | r14767 | r14768 >
Date:06:35, 15 June 2006
Author:robchurch
Status:old
Tags:
Comment:
(bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/JobQueue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -390,6 +390,14 @@
391391 &$personal_urls: Array of link specifiers (see SkinTemplate.php)
392392 &$title: Title object representing the current page
393393
 394+'RunUnknownJob': Handle additional, unknown job queue commands
 395+&$job: Job object to be handled
 396+&$retval: Return value indicating whether or not the operation was successful
 397+
 398+Return true to continue with processing the job through other hooks and code,
 399+or false if the job has been completed. Alter $retval to indicate success or
 400+failure when performing the actual steps to "process" the job.
 401+
394402 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
395403 &$siteNotice: HTML returned as the sitenotice
396404 Return true to allow the normal method of notice selection/rendering to work,
Index: trunk/phase3/includes/JobQueue.php
@@ -187,9 +187,14 @@
188188 $retval = $this->refreshLinks();
189189 break;
190190 default:
191 - $this->error = "Invalid job type {$this->command}, ignoring";
192 - wfDebug( $this->error . "\n" );
193 - $retval = false;
 191+ $retval = true;
 192+ if( wfRunHooks( 'RunUnknownJob', array( &$this, &$retval ) ) ) {
 193+ $this->error = "Invalid job type {$this->command}, ignoring";
 194+ wfDebug( $this->error . "\n" );
 195+ $retval = false;
 196+ } else {
 197+ $retval = true;
 198+ }
194199 }
195200 wfProfileOut( $fname );
196201 return $retval;
Index: trunk/phase3/RELEASE-NOTES
@@ -495,6 +495,7 @@
496496 * (bug 6162) Change date format for Dutch Low Saxon (nds-nl)
497497 * (bug 6296) Update to Indonesian localisation (id) #21
498498 * Introduce EditFormPreloadText hook, see docs/hooks.txt for more information
 499+* (bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information
499500
500501 == Compatibility ==
501502

Status & tagging log