MediaWiki
1.23.0
|
Job for asynchronous upload-by-url. More...
Public Member Functions | |
__construct ( $title, $params) | |
initializeSessionData () | |
Initialize the session data. More... | |
run () | |
Run the job. More... | |
Public Member Functions inherited from Job | |
__construct ( $command, $title, $params=false) | |
allowRetries () | |
getDeduplicationInfo () | |
Subclasses may need to override this to make duplication detection work. More... | |
getLastError () | |
getParams () | |
getReleaseTimestamp () | |
getRootJobParams () | |
getTitle () | |
getType () | |
hasRootJobParams () | |
ignoreDuplicates () | |
insert () | |
Insert a single job into the queue. More... | |
toString () | |
workItemCount () | |
Static Public Member Functions | |
static & | getSessionData ( $key) |
Static Public Member Functions inherited from Job | |
static | batchInsert ( $jobs) |
Batch-insert a group of jobs into the queue. More... | |
static | factory ( $command, Title $title, $params=false) |
Create the appropriate object to handle a specific job. More... | |
static | newRootJobParams ( $key) |
static | pop () |
Pop a job off the front of the queue. More... | |
static | pop_type ( $type) |
Pop a job of a certain type. More... | |
static | safeBatchInsert ( $jobs) |
Insert a group of jobs into the queue. More... | |
Public Attributes | |
UploadFromUrl | $upload |
const | SESSION_KEYNAME = 'wsUploadFromUrlJobData' |
Public Attributes inherited from Job | |
string | $command |
array | $metadata = array() |
Additional queue metadata *. More... | |
array bool | $params |
Array of job parameters or false if none *. More... | |
Protected Member Functions | |
leaveMessage ( $status) | |
Leave a message on the user talk page or in the session according to $params['leaveMessage']. More... | |
storeResultInSession ( $result, $dataKey, $dataValue) | |
Store a result in the session data. More... | |
Protected Member Functions inherited from Job | |
setLastError ( $error) | |
Protected Attributes | |
User | $user |
Protected Attributes inherited from Job | |
string | $error |
Text for error that occurred last *. More... | |
bool | $removeDuplicates |
Expensive jobs may set this to true *. More... | |
Title | $title |
Job for asynchronous upload-by-url.
This job is in fact an interface to UploadFromUrl, which is designed such that it does not require any globals. If it does, fix it elsewhere, do not add globals in here.
Definition at line 33 of file UploadFromUrlJob.php.
UploadFromUrlJob::__construct | ( | $title, | |
$params | |||
) |
Definition at line 40 of file UploadFromUrlJob.php.
References Job\$params, and Job\$title.
|
static |
$key |
Definition at line 178 of file UploadFromUrlJob.php.
References array(), and SESSION_KEYNAME.
Referenced by initializeSessionData(), ApiUpload\selectUploadModule(), and storeResultInSession().
UploadFromUrlJob::initializeSessionData | ( | ) |
Initialize the session data.
Sets the intial result to queued.
Definition at line 169 of file UploadFromUrlJob.php.
References getSessionData().
|
protected |
Leave a message on the user talk page or in the session according to $params['leaveMessage'].
Status | $status |
Definition at line 122 of file UploadFromUrlJob.php.
References storeResultInSession(), text, user, wfMessage(), and wfSetupSession().
Referenced by run().
UploadFromUrlJob::run | ( | ) |
Run the job.
Reimplemented from Job.
Definition at line 44 of file UploadFromUrlJob.php.
References array(), false, global, leaveMessage(), User\newFromName(), UploadBase\OK, storeResultInSession(), text, title, user, wfMessage(), and wfSetupSession().
|
protected |
Store a result in the session data.
Note that the caller is responsible for appropriate session_start and session_write_close calls.
string | $result | the result (Success|Warning|Failure) |
string | $dataKey | the key of the extra data |
mixed | $dataValue | The extra data itself |
Definition at line 160 of file UploadFromUrlJob.php.
References getSessionData().
Referenced by leaveMessage(), and run().
UploadFromUrl UploadFromUrlJob::$upload |
Definition at line 36 of file UploadFromUrlJob.php.
|
protected |
Definition at line 38 of file UploadFromUrlJob.php.
const UploadFromUrlJob::SESSION_KEYNAME = 'wsUploadFromUrlJobData' |
Definition at line 34 of file UploadFromUrlJob.php.
Referenced by getSessionData().