MediaWiki  REL1_24
UploadFromStash Class Reference

Implements uploading from previously stored file. More...

Inheritance diagram for UploadFromStash:
Collaboration diagram for UploadFromStash:

List of all members.

Public Member Functions

 __construct ($user=false, $stash=false, $repo=false)
 getSourceType ()
 getTempFileSha1Base36 ()
 Get the base 36 SHA1 of the file.
 initialize ($key, $name= 'upload_file', $initTempFile=true)
 initializeFromRequest (&$request)
 performUpload ($comment, $pageText, $watch, $user)
 Perform the upload, then remove the database record afterward.
 stashFile (User $user=null)
 Stash the file.
 stashSession ()
 This should return the key instead of the UploadStashFile instance, for backward compatibility.
 unsaveUploadedFile ()
 Remove a temporarily kept file stashed by saveTempUploadedFile().

Static Public Member Functions

static isValidKey ($key)
static isValidRequest ($request)

Protected Attributes

 $mFileKey
 $mFileProps
 $mSourceType
 $mVirtualTempPath

Private Attributes

 $repo
 $stash

Detailed Description

Implements uploading from previously stored file.

Author:
Bryan Tong Minh

Definition at line 30 of file UploadFromStash.php.


Constructor & Destructor Documentation

UploadFromStash::__construct ( user = false,
stash = false,
repo = false 
)
Parameters:
User | bool$userDefault: false
UploadStash | bool$stashDefault: false
FileRepo | bool$repoDefault: false

Definition at line 47 of file UploadFromStash.php.

References $repo, $stash, $user, RepoGroup\singleton(), user, and wfDebug().


Member Function Documentation

Returns:
string

Reimplemented from UploadBase.

Definition at line 134 of file UploadFromStash.php.

Get the base 36 SHA1 of the file.

Returns:
string

Reimplemented from UploadBase.

Definition at line 142 of file UploadFromStash.php.

UploadFromStash::initialize ( key,
name = 'upload_file',
initTempFile = true 
)
Parameters:
string$key
string$name
bool$initTempFile

Definition at line 95 of file UploadFromStash.php.

References $key, $name, UploadBase\getRealPath(), and UploadBase\initializePathInfo().

Referenced by initializeFromRequest().

Parameters:
WebRequest$request

Reimplemented from UploadBase.

Definition at line 118 of file UploadFromStash.php.

References initialize().

static UploadFromStash::isValidKey ( key) [static]
Parameters:
string$key
Returns:
bool

Definition at line 74 of file UploadFromStash.php.

References $key, and UploadStash\KEY_FORMAT_REGEX.

Referenced by isValidRequest().

static UploadFromStash::isValidRequest ( request) [static]
Parameters:
WebRequest$request
Returns:
bool

Reimplemented from UploadBase.

Definition at line 83 of file UploadFromStash.php.

References isValidKey().

UploadFromStash::performUpload ( comment,
pageText,
watch,
user 
)

Perform the upload, then remove the database record afterward.

Parameters:
string$comment
string$pageText
bool$watch
User$user
Returns:
Status

Reimplemented from UploadBase.

Definition at line 188 of file UploadFromStash.php.

References $comment, $user, and unsaveUploadedFile().

UploadFromStash::stashFile ( User user = null)

Stash the file.

Parameters:
User$user
Returns:
UploadStashFile

Reimplemented from UploadBase.

Definition at line 156 of file UploadFromStash.php.

References $user.

Referenced by stashSession().

This should return the key instead of the UploadStashFile instance, for backward compatibility.

Returns:
string

Reimplemented from UploadBase.

Definition at line 168 of file UploadFromStash.php.

References stashFile().

Remove a temporarily kept file stashed by saveTempUploadedFile().

Returns:
bool Success

Definition at line 176 of file UploadFromStash.php.

Referenced by performUpload().


Member Data Documentation

UploadFromStash::$mFileKey [protected]

Definition at line 31 of file UploadFromStash.php.

UploadFromStash::$mFileProps [protected]

Reimplemented from UploadBase.

Definition at line 33 of file UploadFromStash.php.

UploadFromStash::$mSourceType [protected]

Reimplemented from UploadBase.

Definition at line 34 of file UploadFromStash.php.

UploadFromStash::$mVirtualTempPath [protected]

Definition at line 32 of file UploadFromStash.php.

UploadFromStash::$repo [private]

Definition at line 40 of file UploadFromStash.php.

Referenced by __construct().

UploadFromStash::$stash [private]

Definition at line 37 of file UploadFromStash.php.

Referenced by __construct().


The documentation for this class was generated from the following file: