$this->checkPermissions( $user );
// Fetch the file (usually a no-op)
+ /** @var $status Status */
$status = $this->mUpload->fetchFile();
if ( !$status->isGood() ) {
$errors = $status->getErrorsArray();
}
/**
- * Get an uplaod result based on upload context
+ * Get an upload result based on upload context
* @return array
*/
private function getContextResult() {
$warnings = $this->getApiWarnings();
if ( $warnings && !$this->mParams['ignorewarnings'] ) {
- // Get warnings formated in result array format
+ // Get warnings formatted in result array format
return $this->getWarningsResult( $warnings );
} elseif ( $this->mParams['chunk'] ) {
// Add chunk, and get result
}
/**
- * Get Stash Result, throws an expetion if the file could not be stashed.
+ * Get Stash Result, throws an exception if the file could not be stashed.
* @param $warnings array Array of Api upload warnings
* @return array
*/
$filekey = $this->performStash();
} else {
$filekey = $this->mParams['filekey'];
+ /** @var $status Status */
$status = $this->mUpload->addChunk(
$chunkPath, $chunkSize, $this->mParams['offset'] );
if ( !$status->isGood() ) {
}
}
-
/**
* Check warnings.
* Returns a suitable array for inclusion into API results if there were warnings
return $warnings;
}
-
/**
* Perform the actual upload. Returns a suitable result array on success;
* dies on failure.
$this->mParams['text'] = $this->mParams['comment'];
}
+ /** @var $file File */
$file = $this->mUpload->getLocalFile();
$watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() );
"Failed to start PublishStashedFile.php", 'publishfailed' );
}
} else {
+ /** @var $status Status */
$status = $this->mUpload->performUpload( $this->mParams['comment'],
$this->mParams['text'], $watch, $this->getUser() );
),
),
'ignorewarnings' => false,
- 'file' => null,
+ 'file' => array(
+ ApiBase::PARAM_TYPE => 'upload',
+ ),
'url' => null,
'filekey' => null,
'sessionkey' => array(
'filesize' => null,
'offset' => null,
- 'chunk' => null,
+ 'chunk' => array(
+ ApiBase::PARAM_TYPE => 'upload',
+ ),
'async' => false,
'asyncdownload' => false,