MediaWiki
REL1_19
|
Job for asynchronous upload-by-url. More...
Public Member Functions | |
__construct ($title, $params, $id=0) | |
initializeSessionData () | |
Initialize the session data. | |
run () | |
Run the job. | |
Static Public Member Functions | |
static & | getSessionData ($key) |
Public Attributes | |
$upload | |
const | SESSION_KEYNAME = 'wsUploadFromUrlJobData' |
Protected Member Functions | |
leaveMessage ($status) | |
Leave a message on the user talk page or in the session according to $params['leaveMessage']. | |
storeResultInSession ($result, $dataKey, $dataValue) | |
Store a result in the session data. | |
Protected Attributes | |
$user |
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 18 of file UploadFromUrlJob.php.
UploadFromUrlJob::__construct | ( | $ | title, |
$ | params, | ||
$ | id = 0 |
||
) |
Definition at line 31 of file UploadFromUrlJob.php.
References Job\$id, Job\$params, and Job\$title.
static& UploadFromUrlJob::getSessionData | ( | $ | key | ) | [static] |
$key |
Definition at line 158 of file UploadFromUrlJob.php.
References SESSION_KEYNAME.
Referenced by initializeSessionData(), ApiUpload\selectUploadModule(), and storeResultInSession().
Initialize the session data.
Sets the intial result to queued.
Definition at line 149 of file UploadFromUrlJob.php.
References getSessionData().
UploadFromUrlJob::leaveMessage | ( | $ | status | ) | [protected] |
Leave a message on the user talk page or in the session according to $params['leaveMessage'].
$status | Status |
Definition at line 104 of file UploadFromUrlJob.php.
References storeResultInSession(), wfMsg(), and wfSetupSession().
Referenced by run().
Run the job.
Reimplemented from Job.
Definition at line 35 of file UploadFromUrlJob.php.
References $result, false, leaveMessage(), User\newFromName(), UploadBase\OK, storeResultInSession(), wfMsg(), and wfSetupSession().
UploadFromUrlJob::storeResultInSession | ( | $ | result, |
$ | dataKey, | ||
$ | dataValue | ||
) | [protected] |
Store a result in the session data.
Note that the caller is responsible for appropriate session_start and session_write_close calls.
$result | String: the result (Success|Warning|Failure) |
$dataKey | String: the key of the extra data |
$dataValue | Mixed: the extra data itself |
Definition at line 140 of file UploadFromUrlJob.php.
References $result, and getSessionData().
Referenced by leaveMessage(), and run().
UploadFromUrlJob::$upload |
Definition at line 24 of file UploadFromUrlJob.php.
UploadFromUrlJob::$user [protected] |
Definition at line 29 of file UploadFromUrlJob.php.
const UploadFromUrlJob::SESSION_KEYNAME = 'wsUploadFromUrlJobData' |
Definition at line 19 of file UploadFromUrlJob.php.
Referenced by getSessionData().