dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Cleaning up English messages for clarity and correctness"
[lhc/web/wiklou.git]
/
includes
/
job
/
Job.php
diff --git
a/includes/job/Job.php
b/includes/job/Job.php
index
ab7df5d
..
3f44a91
100644
(file)
--- a/
includes/job/Job.php
+++ b/
includes/job/Job.php
@@
-28,27
+28,34
@@
* @ingroup JobQueue
*/
abstract class Job {
* @ingroup JobQueue
*/
abstract class Job {
- /**
- * @var Title
- */
- var $title;
+ /** @var int Job identifier */
+ public $id;
+
+ /** @var string */
+ public $command;
- var $command,
- $params,
- $id,
- $removeDuplicates,
- $error;
+ /** @var array|bool Array of job parameters or false if none */
+ public $params;
- /** @var
A
rray Additional queue metadata */
+ /** @var
a
rray Additional queue metadata */
public $metadata = array();
public $metadata = array();
+ /** @var Title */
+ protected $title;
+
+ /** @var bool Expensive jobs may set this to true */
+ protected $removeDuplicates;
+
+ /** @var string Text for error that occurred last */
+ protected $error;
+
/*-------------------------------------------------------------------------
* Abstract functions
*------------------------------------------------------------------------*/
/**
* Run the job
/*-------------------------------------------------------------------------
* Abstract functions
*------------------------------------------------------------------------*/
/**
* Run the job
- * @return bool
ean s
uccess
+ * @return bool
S
uccess
*/
abstract public function run();
*/
abstract public function run();
@@
-60,7
+67,7
@@
abstract class Job {
* Create the appropriate object to handle a specific job
*
* @param string $command Job command
* Create the appropriate object to handle a specific job
*
* @param string $command Job command
- * @param
$title Title:
Associated title
+ * @param
Title $title
Associated title
* @param array|bool $params Job parameters
* @param int $id Job identifier
* @throws MWException
* @param array|bool $params Job parameters
* @param int $id Job identifier
* @throws MWException
@@
-70,6
+77,7
@@
abstract class Job {
global $wgJobClasses;
if ( isset( $wgJobClasses[$command] ) ) {
$class = $wgJobClasses[$command];
global $wgJobClasses;
if ( isset( $wgJobClasses[$command] ) ) {
$class = $wgJobClasses[$command];
+
return new $class( $title, $params, $id );
}
throw new MWException( "Invalid job command `{$command}`" );
return new $class( $title, $params, $id );
}
throw new MWException( "Invalid job command `{$command}`" );
@@
-122,7
+130,7
@@
abstract class Job {
* Pop a job off the front of the queue.
* This is subject to $wgJobTypesExcludedFromDefaultQueue.
*
* Pop a job off the front of the queue.
* This is subject to $wgJobTypesExcludedFromDefaultQueue.
*
- * @return Job
or false if there's
no jobs
+ * @return Job
|bool False if there are
no jobs
* @deprecated since 1.21
*/
public static function pop() {
* @deprecated since 1.21
*/
public static function pop() {
@@
-145,11
+153,12
@@
abstract class Job {
$this->params = $params;
$this->id = $id;
$this->params = $params;
$this->id = $id;
- $this->removeDuplicates = false; // expensive jobs may set this to true
+ // expensive jobs may set this to true
+ $this->removeDuplicates = false;
}
/**
}
/**
- * @return int
eger
May be 0 for jobs stored outside the DB
+ * @return int May be 0 for jobs stored outside the DB
* @deprecated since 1.22
*/
public function getId() {
* @deprecated since 1.22
*/
public function getId() {
@@
-178,7
+187,7
@@
abstract class Job {
}
/**
}
/**
- * @return int
eger
|null UNIX timestamp to delay running this job until, otherwise null
+ * @return int|null UNIX timestamp to delay running this job until, otherwise null
* @since 1.22
*/
public function getReleaseTimestamp() {
* @since 1.22
*/
public function getReleaseTimestamp() {
@@
-208,7
+217,7
@@
abstract class Job {
* only checked if ignoreDuplicates() returns true, meaning that duplicate
* jobs are supposed to be ignored.
*
* only checked if ignoreDuplicates() returns true, meaning that duplicate
* jobs are supposed to be ignored.
*
- * @return
A
rray Map of key/values
+ * @return
a
rray Map of key/values
* @since 1.21
*/
public function getDeduplicationInfo() {
* @since 1.21
*/
public function getDeduplicationInfo() {
@@
-225,13
+234,14
@@
abstract class Job {
// Likewise for jobs with different delay times
unset( $info['params']['jobReleaseTimestamp'] );
}
// Likewise for jobs with different delay times
unset( $info['params']['jobReleaseTimestamp'] );
}
+
return $info;
}
/**
* @see JobQueue::deduplicateRootJob()
* @param string $key A key that identifies the task
return $info;
}
/**
* @see JobQueue::deduplicateRootJob()
* @param string $key A key that identifies the task
- * @return
A
rray
+ * @return
a
rray
* @since 1.21
*/
public static function newRootJobParams( $key ) {
* @since 1.21
*/
public static function newRootJobParams( $key ) {
@@
-243,7
+253,7
@@
abstract class Job {
/**
* @see JobQueue::deduplicateRootJob()
/**
* @see JobQueue::deduplicateRootJob()
- * @return
A
rray
+ * @return
a
rray
* @since 1.21
*/
public function getRootJobParams() {
* @since 1.21
*/
public function getRootJobParams() {
@@
-305,6
+315,7
@@
abstract class Job {
if ( $paramString !== '' ) {
$s .= ' ' . $paramString;
}
if ( $paramString !== '' ) {
$s .= ' ' . $paramString;
}
+
return $s;
} else {
return "{$this->command} $paramString";
return $s;
} else {
return "{$this->command} $paramString";