MediaWiki
1.33.0
|
Implements uploading from chunks. More...
Public Member Functions | |
__construct (User $user, $stash=false, $repo=false) | |
Setup local pointers to stash, repo and user (similar to UploadFromStash) More... | |
addChunk ( $chunkPath, $chunkSize, $offset) | |
Add a chunk to the temporary directory. More... | |
concatenateChunks () | |
Append the final chunk and ready file for parent::performUpload() More... | |
continueChunks ( $name, $key, $webRequestUpload) | |
Continue chunk uploading. More... | |
getOffset () | |
Get the offset at which the next uploaded chunk will be appended to. More... | |
getVirtualChunkLocation ( $index) | |
Returns the virtual chunk location: More... | |
stashFile (User $user=null) | |
@inheritDoc More... | |
stashFileGetKey () | |
@inheritDoc More... | |
stashSession () | |
@inheritDoc More... | |
tryStashFile (User $user, $isPartial=false) | |
@inheritDoc More... | |
Public Member Functions inherited from UploadFromFile | |
getSourceType () | |
initialize ( $name, $webRequestUpload) | |
Initialize from a filename and a WebRequestUpload. More... | |
initializeFromRequest (&$request) | |
verifyUpload () | |
Protected Member Functions | |
doStashFile (User $user=null) | |
Calls the parent doStashFile and updates the uploadsession table to handle "chunks". More... | |
Protected Attributes | |
$mChunkIndex | |
$mFileKey | |
$mOffset | |
$mVirtualTempPath | |
Protected Attributes inherited from UploadFromFile | |
WebRequestUpload | $mUpload = null |
Private Member Functions | |
getChunkFileKey ( $index=null) | |
getChunkIndex () | |
Get the current Chunk index. More... | |
getChunkStatus () | |
Get the chunk db state and populate update relevant local values. More... | |
outputChunk ( $chunkPath) | |
Output the chunk to disk. More... | |
updateChunkStatus () | |
Update the chunk db table with the current status: More... | |
verifyChunk () | |
Verify that the chunk isn't really an evil html file. More... | |
Private Attributes | |
LocalRepo | $repo |
Additional Inherited Members | |
Static Public Member Functions inherited from UploadFromFile | |
static | isValidRequest ( $request) |
Implements uploading from chunks.
Definition at line 30 of file UploadFromChunks.php.
Setup local pointers to stash, repo and user (similar to UploadFromStash)
User | $user | |
UploadStash | bool | $stash | Default: false |
FileRepo | bool | $repo | Default: false |
Definition at line 45 of file UploadFromChunks.php.
References $repo, $user, RepoGroup\singleton(), user, and wfDebug().
UploadFromChunks::addChunk | ( | $chunkPath, | |
$chunkSize, | |||
$offset | |||
) |
Add a chunk to the temporary directory.
string | $chunkPath | Path to temporary chunk file |
int | $chunkSize | Size of the current chunk |
int | $offset | Offset of current chunk ( mutch match database chunk offset ) |
Definition at line 248 of file UploadFromChunks.php.
References $e, getOffset(), StatusValue\newFatal(), outputChunk(), updateChunkStatus(), and verifyChunk().
UploadFromChunks::concatenateChunks | ( | ) |
Append the final chunk and ready file for parent::performUpload()
Definition at line 159 of file UploadFromChunks.php.
References $e, $ext, $ret, FileRepo\DELETE_SOURCE, FileBackend\extensionFromPath(), TempFSFile\factory(), getChunkIndex(), getOffset(), getVirtualChunkLocation(), user, UploadFromFile\verifyUpload(), wfDebug(), wfDebugLog(), and wfTempDir().
UploadFromChunks::continueChunks | ( | $name, | |
$key, | |||
$webRequestUpload | |||
) |
Continue chunk uploading.
string | $name | |
string | $key | |
WebRequestUpload | $webRequestUpload |
Definition at line 141 of file UploadFromChunks.php.
References $name, and getChunkStatus().
Calls the parent doStashFile and updates the uploadsession table to handle "chunks".
User | null | $user |
Definition at line 114 of file UploadFromChunks.php.
References $user, outputChunk(), and updateChunkStatus().
|
private |
Definition at line 386 of file UploadFromChunks.php.
References getChunkIndex().
Referenced by getVirtualChunkLocation(), and outputChunk().
|
private |
Get the current Chunk index.
Definition at line 332 of file UploadFromChunks.php.
References $mChunkIndex.
Referenced by concatenateChunks(), getChunkFileKey(), and updateChunkStatus().
|
private |
Get the chunk db state and populate update relevant local values.
Definition at line 306 of file UploadFromChunks.php.
Referenced by continueChunks().
UploadFromChunks::getOffset | ( | ) |
Get the offset at which the next uploaded chunk will be appended to.
Definition at line 344 of file UploadFromChunks.php.
References $mOffset.
Referenced by addChunk(), concatenateChunks(), and updateChunkStatus().
UploadFromChunks::getVirtualChunkLocation | ( | $index | ) |
Returns the virtual chunk location:
int | $index |
Definition at line 231 of file UploadFromChunks.php.
References getChunkFileKey().
Referenced by concatenateChunks().
|
private |
Output the chunk to disk.
string | $chunkPath |
UploadChunkFileException |
Definition at line 359 of file UploadFromChunks.php.
References captcha-old\count, and getChunkFileKey().
Referenced by addChunk(), and doStashFile().
@inheritDoc
UploadChunkVerificationException |
Definition at line 80 of file UploadFromChunks.php.
References $user, verifyChunk(), and wfDeprecated().
UploadFromChunks::stashFileGetKey | ( | ) |
@inheritDoc
UploadChunkVerificationException |
Definition at line 91 of file UploadFromChunks.php.
References verifyChunk(), and wfDeprecated().
UploadFromChunks::stashSession | ( | ) |
@inheritDoc
UploadChunkVerificationException |
Definition at line 102 of file UploadFromChunks.php.
References verifyChunk(), and wfDeprecated().
@inheritDoc
Definition at line 65 of file UploadFromChunks.php.
References $e, $user, StatusValue\newFatal(), and verifyChunk().
|
private |
Update the chunk db table with the current status:
Definition at line 286 of file UploadFromChunks.php.
References getChunkIndex(), getOffset(), and wfDebug().
Referenced by addChunk(), and doStashFile().
|
private |
Verify that the chunk isn't really an evil html file.
UploadChunkVerificationException |
Definition at line 399 of file UploadFromChunks.php.
References $mFileKey, and $res.
Referenced by addChunk(), stashFile(), stashFileGetKey(), stashSession(), and tryStashFile().
|
protected |
Definition at line 32 of file UploadFromChunks.php.
Referenced by getChunkIndex().
|
protected |
Definition at line 33 of file UploadFromChunks.php.
Referenced by verifyChunk().
|
protected |
Definition at line 31 of file UploadFromChunks.php.
Referenced by getOffset().
|
protected |
Definition at line 34 of file UploadFromChunks.php.
|
private |
Definition at line 36 of file UploadFromChunks.php.
Referenced by __construct().