From f555a1922f3a554c462b8090d39acc4136b65bd2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 22 Oct 2012 17:23:48 -0700 Subject: [PATCH] Moved core Job classes under includes/job/jobs. Change-Id: I9257bb0fce9791190f731d72b2e882a1ae400f35 --- includes/AutoLoader.php | 16 +++--- includes/cache/HTMLCacheUpdate.php | 30 ----------- includes/job/{ => jobs}/DoubleRedirectJob.php | 0 includes/job/{ => jobs}/EmaillingJob.php | 0 includes/job/{ => jobs}/EnotifNotifyJob.php | 0 includes/job/jobs/HTMLCacheUpdateJob.php | 51 +++++++++++++++++++ includes/job/{ => jobs}/RefreshLinksJob.php | 0 includes/job/{ => jobs}/UploadFromUrlJob.php | 0 8 files changed, 60 insertions(+), 37 deletions(-) rename includes/job/{ => jobs}/DoubleRedirectJob.php (100%) rename includes/job/{ => jobs}/EmaillingJob.php (100%) rename includes/job/{ => jobs}/EnotifNotifyJob.php (100%) create mode 100644 includes/job/jobs/HTMLCacheUpdateJob.php rename includes/job/{ => jobs}/RefreshLinksJob.php (100%) rename includes/job/{ => jobs}/UploadFromUrlJob.php (100%) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 1cf66348d6..d98556ee34 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -435,7 +435,6 @@ $wgAutoloadLocalClasses = array( 'GenderCache' => 'includes/cache/GenderCache.php', 'GlobalDependency' => 'includes/cache/CacheDependency.php', 'HTMLCacheUpdate' => 'includes/cache/HTMLCacheUpdate.php', - 'HTMLCacheUpdateJob' => 'includes/cache/HTMLCacheUpdate.php', 'HTMLFileCache' => 'includes/cache/HTMLFileCache.php', 'LinkBatch' => 'includes/cache/LinkBatch.php', 'LinkCache' => 'includes/cache/LinkCache.php', @@ -652,16 +651,19 @@ $wgAutoloadLocalClasses = array( 'WebInstallerPage' => 'includes/installer/WebInstallerPage.php', # includes/job - 'DoubleRedirectJob' => 'includes/job/DoubleRedirectJob.php', - 'EmaillingJob' => 'includes/job/EmaillingJob.php', - 'EnotifNotifyJob' => 'includes/job/EnotifNotifyJob.php', 'Job' => 'includes/job/Job.php', 'JobQueue' => 'includes/job/JobQueue.php', 'JobQueueDB' => 'includes/job/JobQueueDB.php', 'JobQueueGroup' => 'includes/job/JobQueueGroup.php', - 'RefreshLinksJob' => 'includes/job/RefreshLinksJob.php', - 'RefreshLinksJob2' => 'includes/job/RefreshLinksJob.php', - 'UploadFromUrlJob' => 'includes/job/UploadFromUrlJob.php', + + # includes/job/jobs + 'DoubleRedirectJob' => 'includes/job/jobs/DoubleRedirectJob.php', + 'EmaillingJob' => 'includes/job/jobs/EmaillingJob.php', + 'EnotifNotifyJob' => 'includes/job/jobs/EnotifNotifyJob.php', + 'HTMLCacheUpdateJob' => 'includes/job/jobs/HTMLCacheUpdateJob.php', + 'RefreshLinksJob' => 'includes/job/jobs/RefreshLinksJob.php', + 'RefreshLinksJob2' => 'includes/job/jobs/RefreshLinksJob.php', + 'UploadFromUrlJob' => 'includes/job/jobs/UploadFromUrlJob.php', # includes/json 'FormatJson' => 'includes/json/FormatJson.php', diff --git a/includes/cache/HTMLCacheUpdate.php b/includes/cache/HTMLCacheUpdate.php index 0a3c0023d6..51a28cad88 100644 --- a/includes/cache/HTMLCacheUpdate.php +++ b/includes/cache/HTMLCacheUpdate.php @@ -228,33 +228,3 @@ class HTMLCacheUpdate implements DeferrableUpdate { } } } - - -/** - * Job wrapper for HTMLCacheUpdate. Gets run whenever a related - * job gets called from the queue. - * - * @ingroup JobQueue - */ -class HTMLCacheUpdateJob extends Job { - var $table, $start, $end; - - /** - * Construct a job - * @param $title Title: the title linked to - * @param $params Array: job parameters (table, start and end page_ids) - * @param $id Integer: job id - */ - function __construct( $title, $params, $id = 0 ) { - parent::__construct( 'htmlCacheUpdate', $title, $params, $id ); - $this->table = $params['table']; - $this->start = $params['start']; - $this->end = $params['end']; - } - - public function run() { - $update = new HTMLCacheUpdate( $this->title, $this->table, $this->start, $this->end ); - $update->doUpdate(); - return true; - } -} diff --git a/includes/job/DoubleRedirectJob.php b/includes/job/jobs/DoubleRedirectJob.php similarity index 100% rename from includes/job/DoubleRedirectJob.php rename to includes/job/jobs/DoubleRedirectJob.php diff --git a/includes/job/EmaillingJob.php b/includes/job/jobs/EmaillingJob.php similarity index 100% rename from includes/job/EmaillingJob.php rename to includes/job/jobs/EmaillingJob.php diff --git a/includes/job/EnotifNotifyJob.php b/includes/job/jobs/EnotifNotifyJob.php similarity index 100% rename from includes/job/EnotifNotifyJob.php rename to includes/job/jobs/EnotifNotifyJob.php diff --git a/includes/job/jobs/HTMLCacheUpdateJob.php b/includes/job/jobs/HTMLCacheUpdateJob.php new file mode 100644 index 0000000000..4e6fd6cb53 --- /dev/null +++ b/includes/job/jobs/HTMLCacheUpdateJob.php @@ -0,0 +1,51 @@ +table = $params['table']; + $this->start = $params['start']; + $this->end = $params['end']; + } + + public function run() { + $update = new HTMLCacheUpdate( $this->title, $this->table, $this->start, $this->end ); + $update->doUpdate(); + return true; + } +} diff --git a/includes/job/RefreshLinksJob.php b/includes/job/jobs/RefreshLinksJob.php similarity index 100% rename from includes/job/RefreshLinksJob.php rename to includes/job/jobs/RefreshLinksJob.php diff --git a/includes/job/UploadFromUrlJob.php b/includes/job/jobs/UploadFromUrlJob.php similarity index 100% rename from includes/job/UploadFromUrlJob.php rename to includes/job/jobs/UploadFromUrlJob.php -- 2.20.1