// Stash the file and get stash result
return $this->getStashResult( $warnings );
}
+
// This is the most common case -- a normal upload with no warnings
// performUpload will return a formatted properly for the API with status
return $this->performUpload( $warnings );
} catch ( MWException $e ) {
$this->dieUsage( $e->getMessage(), 'stashfailed' );
}
+
return $result;
}
} catch ( MWException $e ) {
$result['warnings']['stashfailed'] = $e->getMessage();
}
+
return $result;
}
$chunkPath, $chunkSize, $this->mParams['offset'] );
if ( !$status->isGood() ) {
$this->dieUsage( $status->getWikiText(), 'stashfailed' );
+
return array();
}
}
$status = $this->mUpload->concatenateChunks();
if ( !$status->isGood() ) {
$this->dieUsage( $status->getWikiText(), 'stashfailed' );
+
return array();
}
}
$result['filekey'] = $filekey;
$result['offset'] = $this->mParams['offset'] + $chunkSize;
+
return $result;
}
wfDebug( __METHOD__ . ' ' . $message . "\n" );
throw new MWException( $message );
}
+
return $fileKey;
}
}
unset( $progress['status'] ); // remove Status object
$this->getResult()->addValue( null, $this->getModuleName(), $progress );
+
return false;
}
$sessionData['sessionkey'] = $this->mParams['statuskey'];
}
$this->getResult()->addValue( null, $this->getModuleName(), $sessionData );
+
return false;
}
break;
case UploadBase::ILLEGAL_FILENAME:
$this->dieRecoverableError( 'illegal-filename', 'filename',
- array( 'filename' => $verification['filtered'] ) );
+ array( 'filename' => $verification['filtered'] ) );
break;
case UploadBase::FILENAME_TOO_LONG:
$this->dieRecoverableError( 'filename-toolong', 'filename' );
case UploadBase::VERIFICATION_ERROR:
$this->getResult()->setIndexedTagName( $verification['details'], 'detail' );
$this->dieUsage( 'This file did not pass file verification', 'verification-error',
- 0, array( 'details' => $verification['details'] ) );
+ 0, array( 'details' => $verification['details'] ) );
break;
case UploadBase::HOOK_ABORTED:
$this->dieUsage( "The modification you tried to make was aborted by an extension hook",
- 'hookaborted', 0, array( 'error' => $verification['error'] ) );
+ 'hookaborted', 0, array( 'error' => $verification['error'] ) );
break;
default:
$this->dieUsage( 'An unknown error occurred', 'unknown-error',
- 0, array( 'code' => $verification['status'] ) );
+ 0, array( 'code' => $verification['status'] ) );
break;
}
}
$warnings[$warning['warning']] = $localFile->getName();
}
}
+
return $warnings;
}
);
return $params;
-
}
public function getResultProperties() {