Merge "Ensure that User::getId() returns int"
[lhc/web/wiklou.git] / includes / upload / UploadFromChunks.php
index 8ee0845..0323b68 100644 (file)
@@ -142,16 +142,15 @@ class UploadFromChunks extends UploadFromFile {
                $tStart = microtime( true );
                $status = $this->repo->concatenate( $fileList, $tmpPath, FileRepo::DELETE_SOURCE );
                $tAmount = microtime( true ) - $tStart;
-               if ( !$status->isOk() ) {
+               if ( !$status->isOK() ) {
                        return $status;
                }
 
                wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds." );
 
-               // File system path
-               $this->mTempPath = $tmpPath;
-               // Since this was set for the last chunk previously
-               $this->mFileSize = filesize( $this->mTempPath );
+               // File system path of the actual full temp file
+               $this->setTempFile( $tmpPath );
+
                $ret = $this->verifyUpload();
                if ( $ret['status'] !== UploadBase::OK ) {
                        wfDebugLog( 'fileconcatenate', "Verification failed for chunked upload" );
@@ -235,7 +234,7 @@ class UploadFromChunks extends UploadFromFile {
                wfDebug( __METHOD__ . " update chunk status for {$this->mFileKey} offset:" .
                        $this->getOffset() . ' inx:' . $this->getChunkIndex() . "\n" );
 
-               $dbw = $this->repo->getMasterDb();
+               $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->update(
@@ -257,7 +256,7 @@ class UploadFromChunks extends UploadFromFile {
        private function getChunkStatus() {
                // get Master db to avoid race conditions.
                // Otherwise, if chunk upload time < replag there will be spurious errors
-               $dbw = $this->repo->getMasterDb();
+               $dbw = $this->repo->getMasterDB();
                $row = $dbw->selectRow(
                        'uploadstash',
                        [