* Upload a file directly into archive. Generally for Special:Import.
*
* @param string $srcPath File system path of the source file
- * @param string $archiveName Full archive name of the file, in the form
- * $timestamp!$filename, where $filename must match $this->getName()
* @param string $timestamp
* @param string $comment
* @param User $user
* @return Status
*/
- function uploadOld( $srcPath, $archiveName, $timestamp, $comment, $user ) {
+ public function uploadOld( $srcPath, $timestamp, $comment, $user ) {
$this->lock();
+ $archiveName = $this->getArchiveName();
$dstRel = $this->getArchiveRel( $archiveName );
$status = $this->publishTo( $srcPath, $dstRel );
?: User::newFromName( $importableRevision->getUser(), false );
# Do the actual upload
- if ( $archiveName ) {
- $status = $file->uploadOld( $source, $archiveName,
- $importableRevision->getTimestamp(), $importableRevision->getComment(), $user );
+ if ( $file instanceof OldLocalFile ) {
+ $status = $file->uploadOld(
+ $source,
+ $importableRevision->getTimestamp(),
+ $importableRevision->getComment(),
+ $user
+ );
} else {
$flags = 0;
$status = $file->upload(