From 67ee817f0e1b9e039d4f00c196621db09378a2d0 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 15 Jun 2006 06:35:24 +0000 Subject: [PATCH] (bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information --- RELEASE-NOTES | 1 + docs/hooks.txt | 8 ++++++++ includes/JobQueue.php | 11 ++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 13fe018983..bfd2013eed 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/docs/hooks.txt b/docs/hooks.txt index a8c0ff1821..ff6b89b799 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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, diff --git a/includes/JobQueue.php b/includes/JobQueue.php index ed4c02c0d0..831d37e8d4 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -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; -- 2.20.1