MediaWiki  REL1_24
UploadFromChunks Class Reference

Implements uploading from chunks. More...

Inheritance diagram for UploadFromChunks:
Collaboration diagram for UploadFromChunks:

List of all members.

Public Member Functions

 __construct ($user=null, $stash=false, $repo=false)
 Setup local pointers to stash, repo and user (similar to UploadFromStash)
 addChunk ($chunkPath, $chunkSize, $offset)
 Add a chunk to the temporary directory.
 concatenateChunks ()
 Append the final chunk and ready file for parent::performUpload()
 continueChunks ($name, $key, $webRequestUpload)
 Continue chunk uploading.
 getVirtualChunkLocation ($index)
 Returns the virtual chunk location:
 performUpload ($comment, $pageText, $watch, $user)
 Perform the upload, then remove the temp copy afterward.
 stashFile (User $user=null)
 Calls the parent stashFile and updates the uploadsession table to handle "chunks".

Protected Attributes

 $mChunkIndex
 $mFileKey
 $mOffset
 $mVirtualTempPath

Private Member Functions

 getChunkFileKey ($index=null)
 getChunkIndex ()
 Get the current Chunk index.
 getChunkStatus ()
 Get the chunk db state and populate update relevant local values.
 getOffset ()
 Gets the current offset in fromt the stashedupload table.
 outputChunk ($chunkPath)
 Output the chunk to disk.
 updateChunkStatus ()
 Update the chunk db table with the current status:
 verifyChunk ()
 Verify that the chunk isn't really an evil html file.

Private Attributes

LocalRepo $repo
 *

Detailed Description

Implements uploading from chunks.

Author:
Michael Dale

Definition at line 30 of file UploadFromChunks.php.


Constructor & Destructor Documentation

UploadFromChunks::__construct ( user = null,
stash = false,
repo = false 
)

Setup local pointers to stash, repo and user (similar to UploadFromStash)

Parameters:
User | null$userDefault: null
UploadStash | bool$stashDefault: false
FileRepo | bool$repoDefault: false

Definition at line 44 of file UploadFromChunks.php.


Member Function Documentation

UploadFromChunks::addChunk ( chunkPath,
chunkSize,
offset 
)

Add a chunk to the temporary directory.

Parameters:
string$chunkPathPath to temporary chunk file
int$chunkSizeSize of the current chunk
int$offsetOffset of current chunk ( mutch match database chunk offset )
Returns:
Status

Definition at line 208 of file UploadFromChunks.php.

Append the final chunk and ready file for parent::performUpload()

Returns:
FileRepoStatus

Definition at line 118 of file UploadFromChunks.php.

UploadFromChunks::continueChunks ( name,
key,
webRequestUpload 
)

Continue chunk uploading.

Parameters:
string$name
string$key
WebRequestUpload$webRequestUpload

Definition at line 100 of file UploadFromChunks.php.

UploadFromChunks::getChunkFileKey ( index = null) [private]

Definition at line 350 of file UploadFromChunks.php.

References getChunkIndex().

Get the current Chunk index.

Returns:
int Index of the current chunk

Definition at line 296 of file UploadFromChunks.php.

Referenced by getChunkFileKey().

Get the chunk db state and populate update relevant local values.

Definition at line 270 of file UploadFromChunks.php.

Gets the current offset in fromt the stashedupload table.

Returns:
int Current byte offset of the chunk file set

Definition at line 308 of file UploadFromChunks.php.

Returns the virtual chunk location:

Parameters:
int$index
Returns:
string

Definition at line 191 of file UploadFromChunks.php.

UploadFromChunks::outputChunk ( chunkPath) [private]

Output the chunk to disk.

Parameters:
string$chunkPath
Exceptions:
UploadChunkFileException
Returns:
FileRepoStatus

Definition at line 323 of file UploadFromChunks.php.

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

Perform the upload, then remove the temp copy afterward.

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

Reimplemented from UploadBase.

Definition at line 180 of file UploadFromChunks.php.

UploadFromChunks::stashFile ( User user = null)

Calls the parent stashFile and updates the uploadsession table to handle "chunks".

Parameters:
User | null$user
Returns:
UploadStashFile Stashed file

Reimplemented from UploadBase.

Definition at line 72 of file UploadFromChunks.php.

Update the chunk db table with the current status:

Definition at line 246 of file UploadFromChunks.php.

Verify that the chunk isn't really an evil html file.

Exceptions:
UploadChunkVerificationException

Definition at line 363 of file UploadFromChunks.php.


Member Data Documentation

UploadFromChunks::$mChunkIndex [protected]

Definition at line 32 of file UploadFromChunks.php.

UploadFromChunks::$mFileKey [protected]

Definition at line 33 of file UploadFromChunks.php.

UploadFromChunks::$mOffset [protected]

Definition at line 31 of file UploadFromChunks.php.

UploadFromChunks::$mVirtualTempPath [protected]

Definition at line 34 of file UploadFromChunks.php.

LocalRepo UploadFromChunks::$repo [private]

*

Definition at line 35 of file UploadFromChunks.php.


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