// Update db table to reflect initial "chunk" state
$this->updateChunkStatus();
+
return $this->mLocalFile;
}
if ( $ret['status'] !== UploadBase::OK ) {
wfDebugLog( 'fileconcatenate', "Verification failed for chunked upload" );
$status->fatal( $this->getVerificationErrorCode( $ret['status'] ) );
+
return $status;
}
*/
public function performUpload( $comment, $pageText, $watch, $user ) {
$rv = parent::performUpload( $comment, $pageText, $watch, $user );
+
return $rv;
}
*/
function getVirtualChunkLocation( $index ) {
return $this->repo->getVirtualUrl( 'temp' ) .
- '/' .
- $this->repo->getHashPath(
- $this->getChunkFileKey( $index )
- ) .
- $this->getChunkFileKey( $index );
+ '/' .
+ $this->repo->getHashPath(
+ $this->getChunkFileKey( $index )
+ ) .
+ $this->getChunkFileKey( $index );
}
/**
$status = Status::newFatal( 'invalid-chunk-offset' );
}
}
+
return $status;
}
*/
private function updateChunkStatus() {
wfDebug( __METHOD__ . " update chunk status for {$this->mFileKey} offset:" .
- $this->getOffset() . ' inx:' . $this->getChunkIndex() . "\n" );
+ $this->getOffset() . ' inx:' . $this->getChunkIndex() . "\n" );
$dbw = $this->repo->getMasterDb();
// Use a quick transaction since we will upload the full temp file into shared
if ( $this->mChunkIndex !== null ) {
return $this->mChunkIndex;
}
+
return 0;
}
if ( $this->mOffset !== null ) {
return $this->mOffset;
}
+
return 0;
}
$this->repo->getZonePath( 'temp' ) . "/{$hashPath}{$fileKey}" );
// Check for error in stashing the chunk:
- if ( ! $storeStatus->isOK() ) {
+ if ( !$storeStatus->isOK() ) {
$error = $storeStatus->getErrorsArray();
$error = reset( $error );
- if ( ! count( $error ) ) {
+ if ( !count( $error ) ) {
$error = $storeStatus->getWarningsArray();
$error = reset( $error );
- if ( ! count( $error ) ) {
+ if ( !count( $error ) ) {
$error = array( 'unknown', 'no error recorded' );
}
}
throw new UploadChunkFileException( "Error storing file in '$chunkPath': " .
implode( '; ', $error ) );
}
+
return $storeStatus;
}
if ( $index === null ) {
$index = $this->getChunkIndex();
}
+
return $this->mFileKey . '.' . $index;
}