(bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information
authorRob Church <robchurch@users.mediawiki.org>
Thu, 15 Jun 2006 06:35:24 +0000 (06:35 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 15 Jun 2006 06:35:24 +0000 (06:35 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/JobQueue.php

index 13fe018..bfd2013 100644 (file)
@@ -495,6 +495,7 @@ Some default configuration options have changed:
 * (bug 6162) Change date format for Dutch Low Saxon (nds-nl)
 * (bug 6296) Update to Indonesian localisation (id) #21
 * Introduce EditFormPreloadText hook, see docs/hooks.txt for more information
+* (bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information
 
 == Compatibility ==
 
index a8c0ff1..ff6b89b 100644 (file)
@@ -390,6 +390,14 @@ my talk page, my contributions" etc).
 &$personal_urls: Array of link specifiers (see SkinTemplate.php)
 &$title: Title object representing the current page
 
+'RunUnknownJob': Handle additional, unknown job queue commands
+&$job: Job object to be handled
+&$retval: Return value indicating whether or not the operation was successful
+
+Return true to continue with processing the job through other hooks and code,
+or false if the job has been completed. Alter $retval to indicate success or
+failure when performing the actual steps to "process" the job.
+
 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
 &$siteNotice: HTML returned as the sitenotice
 Return true to allow the normal method of notice selection/rendering to work,
index ed4c02c..831d37e 100644 (file)
@@ -187,9 +187,14 @@ class Job {
                                $retval = $this->refreshLinks();
                                break;
                        default:
-                               $this->error = "Invalid job type {$this->command}, ignoring";
-                               wfDebug( $this->error . "\n" );
-                               $retval = false;
+                               $retval = true;
+                               if( wfRunHooks( 'RunUnknownJob', array( &$this, &$retval ) ) ) {
+                                       $this->error = "Invalid job type {$this->command}, ignoring";
+                                       wfDebug( $this->error . "\n" );
+                                       $retval = false;
+                               } else {
+                                       $retval = true;
+                               }
                }
                wfProfileOut( $fname );
                return $retval;