From: Aaron Schulz Date: Mon, 16 Dec 2013 06:31:07 +0000 (-0800) Subject: Removed deprecated job ID cruft X-Git-Tag: 1.31.0-rc.0~17607^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=1417ff222ddff8087c55289aa519a5e6764689bf;p=lhc%2Fweb%2Fwiklou.git Removed deprecated job ID cruft Change-Id: I1db3b9adeaaeb66821e9ff6a931f7905ce916b7f --- diff --git a/includes/job/Job.php b/includes/job/Job.php index e33baf535a..f08a3677a1 100644 --- a/includes/job/Job.php +++ b/includes/job/Job.php @@ -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 */ diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index b795695a9d..79ff4e8662 100644 --- a/includes/job/JobQueueDB.php +++ b/includes/job/JobQueueDB.php @@ -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; } ); diff --git a/includes/job/jobs/DuplicateJob.php b/includes/job/jobs/DuplicateJob.php index 7e5bd3ca16..b0a6ef7dbd 100644 --- a/includes/job/jobs/DuplicateJob.php +++ b/includes/job/jobs/DuplicateJob.php @@ -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;