MediaWiki  1.30.2
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
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

◆ getSourceType()

UploadFromStash::getSourceType ( )
Returns
string

Definition at line 134 of file UploadFromStash.php.

References $mSourceType.

◆ getTempFileSha1Base36()

UploadFromStash::getTempFileSha1Base36 ( )

Get the base 36 SHA1 of the file.

Returns
string

Definition at line 142 of file UploadFromStash.php.

◆ initialize()

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

Definition at line 95 of file UploadFromStash.php.

References $name.

Referenced by initializeFromRequest().

◆ initializeFromRequest()

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

Definition at line 118 of file UploadFromStash.php.

References $request, and initialize().

◆ isValidKey()

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

Definition at line 74 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 83 of file UploadFromStash.php.

References $request, and isValidKey().

Referenced by UploadStashTest\testValidRequestWithInvalidRequests(), and UploadStashTest\testValidRequestWithValidRequests().

◆ postProcessUpload()

UploadFromStash::postProcessUpload ( )

Remove the database record after a successful upload.

Definition at line 157 of file UploadFromStash.php.

References unsaveUploadedFile().

◆ unsaveUploadedFile()

UploadFromStash::unsaveUploadedFile ( )

Remove a temporarily kept file stashed by saveTempUploadedFile().

Returns
bool Success

Definition at line 150 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: