MediaWiki
1.30.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 252 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 163 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 145 of file UploadFromChunks.php.
References $name, and getChunkStatus().
|
protected |
Calls the parent doStashFile and updates the uploadsession table to handle "chunks".
User | null | $user |
Definition at line 118 of file UploadFromChunks.php.
References $user, outputChunk(), and updateChunkStatus().
|
private |
Definition at line 390 of file UploadFromChunks.php.
References getChunkIndex().
Referenced by getVirtualChunkLocation(), and outputChunk().
|
private |
Get the current Chunk index.
Definition at line 336 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 310 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 348 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 235 of file UploadFromChunks.php.
References getChunkFileKey().
Referenced by concatenateChunks().
|
private |
Output the chunk to disk.
string | $chunkPath |
UploadChunkFileException |
Definition at line 363 of file UploadFromChunks.php.
References captcha-old\count, and getChunkFileKey().
Referenced by addChunk(), and doStashFile().
UploadFromChunks::stashFile | ( | User | $user = null | ) |
@inheritDoc
UploadChunkVerificationException |
Definition at line 84 of file UploadFromChunks.php.
References $user, verifyChunk(), and wfDeprecated().
UploadFromChunks::stashFileGetKey | ( | ) |
@inheritDoc
UploadChunkVerificationException |
Definition at line 95 of file UploadFromChunks.php.
References verifyChunk(), and wfDeprecated().
UploadFromChunks::stashSession | ( | ) |
@inheritDoc
UploadChunkVerificationException |
Definition at line 106 of file UploadFromChunks.php.
References verifyChunk(), and wfDeprecated().
@inheritDoc
Definition at line 69 of file UploadFromChunks.php.
References $e, $user, StatusValue\newFatal(), and verifyChunk().
|
private |
Update the chunk db table with the current status:
Definition at line 290 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 403 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().