* @param $stash UploadStash
* @param $repo FileRepo
*/
- public function __construct( $user = false, $stash = false, $repo = false ) {
+ public function __construct( $user = null, $stash = false, $repo = false ) {
// user object. sometimes this won't exist, as when running from cron.
$this->user = $user;
return true;
}
+
/**
* Calls the parent stashFile and updates the uploadsession table to handle "chunks"
*
// ( for FileUpload or normal Stash to take over )
$this->mTempPath = $tmpPath; // file system path
$tStart = microtime( true );
- $this->mLocalFile = parent::stashFile();
+ $this->mLocalFile = parent::stashFile( $this->user );
$tAmount = microtime( true ) - $tStart;
$this->mLocalFile->setLocalReference( $tmpFile ); // reuse (e.g. for getImageInfo())
wfDebugLog( 'fileconcatenate', "Stashed combined file ($i chunks) in $tAmount seconds.\n" );
$dbw = $this->repo->getMasterDb();
// Use a quick transaction since we will upload the full temp file into shared
// storage, which takes time for large files. We don't want to hold locks then.
- $dbw->begin();
+ $dbw->begin( __METHOD__ );
$dbw->update(
'uploadstash',
array(
array( 'us_key' => $this->mFileKey ),
__METHOD__
);
- $dbw->commit();
+ $dbw->commit( __METHOD__ );
}
/**