MediaWiki  master
UploadFromStash Class Reference

Implements uploading from previously stored file. More...

Inheritance diagram for UploadFromStash:
Collaboration diagram for UploadFromStash:

Public Member Functions

 __construct ( $user=false, $stash=false, $repo=false)
 
 getSourceType ()
 
 getTempFileSha1Base36 ()
 Get the base 36 SHA1 of the file. More...
 
 initialize ( $key, $name='upload_file', $initTempFile=true)
 
 initializeFromRequest (&$request)
 
 postProcessUpload ()
 Remove the database record after a successful upload. More...
 
 unsaveUploadedFile ()
 Remove a temporarily kept file stashed by saveTempUploadedFile(). More...
 

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

◆ __construct()

UploadFromStash::__construct (   $user = false,
  $stash = false,
  $repo = false 
)
Parameters
User | bool$userDefault: false Sometimes this won't exist, as when running from cron.
UploadStash | bool$stashDefault: false
FileRepo | bool$repoDefault: false

Definition at line 47 of file UploadFromStash.php.

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

Member Function Documentation

◆ getSourceType()

UploadFromStash::getSourceType ( )
Returns
string

Definition at line 131 of file UploadFromStash.php.

References $mSourceType.

◆ getTempFileSha1Base36()

UploadFromStash::getTempFileSha1Base36 ( )

Get the base 36 SHA1 of the file.

Returns
string

Definition at line 139 of file UploadFromStash.php.

◆ initialize()

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

Definition at line 92 of file UploadFromStash.php.

Referenced by initializeFromRequest().

◆ initializeFromRequest()

UploadFromStash::initializeFromRequest ( $request)
Parameters
WebRequest&$request

Definition at line 115 of file UploadFromStash.php.

References initialize().

◆ isValidKey()

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

Definition at line 71 of file UploadFromStash.php.

References UploadStash\KEY_FORMAT_REGEX.

Referenced by isValidRequest(), and ApiUpload\selectUploadModule().

◆ isValidRequest()

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

Definition at line 80 of file UploadFromStash.php.

References isValidKey().

◆ postProcessUpload()

UploadFromStash::postProcessUpload ( )

Remove the database record after a successful upload.

Definition at line 154 of file UploadFromStash.php.

References unsaveUploadedFile().

◆ unsaveUploadedFile()

UploadFromStash::unsaveUploadedFile ( )

Remove a temporarily kept file stashed by saveTempUploadedFile().

Returns
bool Success

Definition at line 147 of file UploadFromStash.php.

Referenced by postProcessUpload().

Member Data Documentation

◆ $mFileKey

UploadFromStash::$mFileKey
protected

Definition at line 31 of file UploadFromStash.php.

◆ $mFileProps

UploadFromStash::$mFileProps
protected

Definition at line 33 of file UploadFromStash.php.

◆ $mSourceType

UploadFromStash::$mSourceType
protected

Definition at line 34 of file UploadFromStash.php.

Referenced by getSourceType().

◆ $mVirtualTempPath

UploadFromStash::$mVirtualTempPath
protected

Definition at line 32 of file UploadFromStash.php.

◆ $repo

UploadFromStash::$repo
private

Definition at line 40 of file UploadFromStash.php.

Referenced by __construct().

◆ $stash

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: