X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUpload.php;h=49306d73442baeb7bfcdeca19491922df6f9c46f;hb=e292bc972dd198b864d92caaf2e8896091f0f893;hp=c54e8baad37375fac20de3e98506a71f38b31d87;hpb=10d401dd40e0e8a8e815ee665e0da5fd43aaa85e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index c54e8baad3..49306d7344 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -92,7 +92,7 @@ class ApiUpload extends ApiBase { } elseif ( $this->mParams['async'] && $this->mParams['filekey'] ) { // defer verification to background process } else { - wfDebug( __METHOD__ . 'about to verify' ); + wfDebug( __METHOD__ . " about to verify\n" ); $this->verifyUpload(); } @@ -234,7 +234,7 @@ class ApiUpload extends ApiBase { array( 'result' => 'Poll', 'stage' => 'queued', 'status' => Status::newGood() ) ); - $ok = JobQueueGroup::singleton()->push( new AssembleUploadChunksJob( + JobQueueGroup::singleton()->push( new AssembleUploadChunksJob( Title::makeTitle( NS_FILE, $filekey ), array( 'filename' => $this->mParams['filename'], @@ -242,13 +242,7 @@ class ApiUpload extends ApiBase { 'session' => $this->getContext()->exportSession() ) ) ); - if ( $ok ) { - $result['result'] = 'Poll'; - } else { - UploadBase::setSessionStatus( $filekey, false ); - $this->dieUsage( - "Failed to start AssembleUploadChunks.php", 'stashfailed' ); - } + $result['result'] = 'Poll'; } else { $status = $this->mUpload->concatenateChunks(); if ( !$status->isGood() ) { @@ -275,7 +269,7 @@ class ApiUpload extends ApiBase { * Stash the file and return the file key * Also re-raises exceptions with slightly more informative message strings (useful for API) * @throws MWException - * @return String file key + * @return string File key */ private function performStash() { try { @@ -446,7 +440,7 @@ class ApiUpload extends ApiBase { /** * Checks that the user has permissions to perform this upload. * Dies with usage message on inadequate permissions. - * @param $user User The user to check. + * @param User $user The user to check. */ protected function checkPermissions( $user ) { // Check whether the user has the appropriate permissions to upload anyway @@ -625,7 +619,7 @@ class ApiUpload extends ApiBase { $this->mParams['filekey'], array( 'result' => 'Poll', 'stage' => 'queued', 'status' => Status::newGood() ) ); - $ok = JobQueueGroup::singleton()->push( new PublishStashedFileJob( + JobQueueGroup::singleton()->push( new PublishStashedFileJob( Title::makeTitle( NS_FILE, $this->mParams['filename'] ), array( 'filename' => $this->mParams['filename'], @@ -636,13 +630,7 @@ class ApiUpload extends ApiBase { 'session' => $this->getContext()->exportSession() ) ) ); - if ( $ok ) { - $result['result'] = 'Poll'; - } else { - UploadBase::setSessionStatus( $this->mParams['filekey'], false ); - $this->dieUsage( - "Failed to start PublishStashedFile.php", 'publishfailed' ); - } + $result['result'] = 'Poll'; } else { /** @var $status Status */ $status = $this->mUpload->performUpload( $this->mParams['comment'],