Removed deprecated job ID cruft
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 16 Dec 2013 06:31:07 +0000 (22:31 -0800)
committerTim Starling <tstarling@wikimedia.org>
Tue, 17 Dec 2013 06:51:03 +0000 (06:51 +0000)
Change-Id: I1db3b9adeaaeb66821e9ff6a931f7905ce916b7f

includes/job/Job.php
includes/job/JobQueueDB.php
includes/job/jobs/DuplicateJob.php

index e33baf5..f08a367 100644 (file)
@@ -28,9 +28,6 @@
  * @ingroup JobQueue
  */
 abstract class Job {
-       /** @var int Job identifier */
-       public $id;
-
        /** @var string */
        public $command;
 
@@ -145,26 +142,16 @@ abstract class Job {
         * @param $command
         * @param $title
         * @param $params array|bool
-        * @param $id int
         */
-       public function __construct( $command, $title, $params = false, $id = 0 ) {
+       public function __construct( $command, $title, $params = false ) {
                $this->command = $command;
                $this->title = $title;
                $this->params = $params;
-               $this->id = $id;
 
                // expensive jobs may set this to true
                $this->removeDuplicates = false;
        }
 
-       /**
-        * @return int May be 0 for jobs stored outside the DB
-        * @deprecated since 1.22
-        */
-       public function getId() {
-               return $this->id;
-       }
-
        /**
         * @return string
         */
index b795695..79ff4e8 100644 (file)
@@ -324,7 +324,6 @@ class JobQueueDB extends JobQueue {
                                $job = Job::factory( $row->job_cmd, $title,
                                        self::extractBlob( $row->job_params ), $row->job_id );
                                $job->metadata['id'] = $row->job_id;
-                               $job->id = $row->job_id; // XXX: work around broken subclasses
                                break; // done
                        } while ( true );
                } catch ( DBError $e ) {
@@ -596,11 +595,9 @@ class JobQueueDB extends JobQueue {
                                        $job = Job::factory(
                                                $row->job_cmd,
                                                Title::makeTitle( $row->job_namespace, $row->job_title ),
-                                               strlen( $row->job_params ) ? unserialize( $row->job_params ) : false,
-                                               $row->job_id
+                                               strlen( $row->job_params ) ? unserialize( $row->job_params ) : false
                                        );
                                        $job->metadata['id'] = $row->job_id;
-                                       $job->id = $row->job_id; // XXX: work around broken subclasses
                                        return $job;
                                }
                        );
index 7e5bd3c..b0a6ef7 100644 (file)
@@ -32,10 +32,9 @@ final class DuplicateJob extends Job {
         *
         * @param Title $title
         * @param array $params job parameters
-        * @param $id Integer: job id
         */
-       function __construct( $title, $params, $id = 0 ) {
-               parent::__construct( 'duplicate', $title, $params, $id );
+       function __construct( $title, $params ) {
+               parent::__construct( 'duplicate', $title, $params );
        }
 
        /**
@@ -45,7 +44,7 @@ final class DuplicateJob extends Job {
         * @return Job
         */
        public static function newFromJob( Job $job ) {
-               $djob = new self( $job->getTitle(), $job->getParams(), $job->id );
+               $djob = new self( $job->getTitle(), $job->getParams() );
                $djob->command = $job->getType();
                $djob->params = is_array( $djob->params ) ? $djob->params : array();
                $djob->params = array( 'isDuplicate' => true ) + $djob->params;