MediaWiki  REL1_20
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=false, $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 ()
 Calls the parent stashFile and updates the uploadsession table to handle "chunks".

Public Attributes

 $mChunkIndex
 $mFileKey
 $mVirtualTempPath

Protected Attributes

 $mOffset

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.

Detailed Description

Implements uploading from chunks.

Author:
Michael Dale

Definition at line 30 of file UploadFromChunks.php.


Constructor & Destructor Documentation

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

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

Parameters:
$userUser
$stashUploadStash
$repoFileRepo

Definition at line 40 of file UploadFromChunks.php.

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


Member Function Documentation

UploadFromChunks::addChunk ( chunkPath,
chunkSize,
offset 
)

Add a chunk to the temporary directory.

Parameters:
$chunkPathstring path to temporary chunk file
$chunkSizeint size of the current chunk
$offsetint offset of current chunk ( mutch match database chunk offset )
Returns:
Status

Definition at line 184 of file UploadFromChunks.php.

References UploadBase\getMaxUploadSize(), getOffset(), Status\newFatal(), outputChunk(), updateChunkStatus(), and verifyChunk().

UploadFromChunks::continueChunks ( name,
key,
webRequestUpload 
)

Continue chunk uploading.

Definition at line 91 of file UploadFromChunks.php.

References getChunkStatus(), UploadBase\getRealPath(), and UploadBase\initializePathInfo().

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

Definition at line 317 of file UploadFromChunks.php.

References getChunkIndex().

Referenced by getVirtualChunkLocation(), and outputChunk().

Get the current Chunk index.

Returns:
Integer index of the current chunk

Definition at line 267 of file UploadFromChunks.php.

Referenced by concatenateChunks(), getChunkFileKey(), and updateChunkStatus().

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

Definition at line 241 of file UploadFromChunks.php.

Referenced by continueChunks().

Gets the current offset in fromt the stashedupload table.

Returns:
Integer current byte offset of the chunk file set

Definition at line 278 of file UploadFromChunks.php.

Referenced by addChunk(), concatenateChunks(), and updateChunkStatus().

Returns the virtual chunk location:

Parameters:
$index
Returns:
string

Definition at line 167 of file UploadFromChunks.php.

References getChunkFileKey().

Referenced by concatenateChunks().

UploadFromChunks::outputChunk ( chunkPath) [private]

Output the chunk to disk.

Parameters:
$chunkPathstring
Exceptions:
UploadChunkFileException
Returns:
FileRepoStatus

Definition at line 292 of file UploadFromChunks.php.

References getChunkFileKey().

Referenced by addChunk(), and stashFile().

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

Perform the upload, then remove the temp copy afterward.

Parameters:
$commentstring
$pageTextstring
$watchbool
$userUser
Returns:
Status

Reimplemented from UploadBase.

Definition at line 157 of file UploadFromChunks.php.

References $comment, and $user.

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

Returns:
UploadStashFile stashed file

Reimplemented from UploadBase.

Definition at line 68 of file UploadFromChunks.php.

References outputChunk(), updateChunkStatus(), and verifyChunk().

Referenced by concatenateChunks().

Update the chunk db table with the current status:

Definition at line 221 of file UploadFromChunks.php.

References getChunkIndex(), getOffset(), and wfDebug().

Referenced by addChunk(), and stashFile().

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

Exceptions:
UploadChunkVerificationException

Definition at line 329 of file UploadFromChunks.php.

References $res, and UploadBase\verifyPartialFile().

Referenced by addChunk(), and stashFile().


Member Data Documentation

UploadFromChunks::$mChunkIndex

Definition at line 31 of file UploadFromChunks.php.

UploadFromChunks::$mFileKey

Definition at line 31 of file UploadFromChunks.php.

UploadFromChunks::$mOffset [protected]

Definition at line 31 of file UploadFromChunks.php.

UploadFromChunks::$mVirtualTempPath

Definition at line 31 of file UploadFromChunks.php.


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