Skip to content

Commit

Permalink
Optimize a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed Oct 31, 2015
1 parent c543656 commit bb2ccf9
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function valuate()
if (!$this->sharpRepository instanceof SharpEloquentRepositoryUpdaterWithUploads) {
throw new MandatoryClassNotFoundException(
get_class($this->sharpRepository) . ' must implement'
. ' Dvlpp\Sharp\Repositories\SharpEloquentRepositoryUpdaterWithUploads'
. SharpEloquentRepositoryUpdaterWithUploads::class
. ' to manage auto update of file uploads');
}

Expand Down Expand Up @@ -127,10 +127,11 @@ private function moveUploadedFile()
// Create storage dir if needed
if (!$this->fileSystemManager->disk($storageDisk)->exists($relativeDestDir)) {
$this->fileSystemManager->disk($storageDisk)->makeDirectory($relativeDestDir, 0777, true);
}

// Find an available name for the file
$fileName = $this->findAvailableFileName($relativeDestDir, $fileName, $storageDisk);
} else {
// Find an available name for the file (only if remote dir already exists)
$fileName = $this->findAvailableFileName($relativeDestDir, $fileName, $storageDisk);
}

// Get mime and size from the $srcFileDisk: if the storage is in cloud,
// it will be faster this way.
Expand Down

0 comments on commit bb2ccf9

Please sign in to comment.