Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
php:
version: 7.0.4
version: 7.1.9

dependencies:
cache_directories:
Expand Down
6 changes: 4 additions & 2 deletions src/Contracts/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@ interface Uploader
*
* @param string $path
* @param string|null $disk
* @param mixed $options
*
* @throws \Shoperti\Uploader\Exceptions\DisallowedFileException
* @throws \Shoperti\Uploader\Exceptions\RemoteFileException
*
* @return \Shoperti\Uploader\UploadResult
*/
public function upload($path, $disk = null);
public function upload($path, $disk = null, $options = []);

/*
* Uploads a file to a filesystem disk with a name.
*
* @param string $path
* @param string $name
* @param string|null $disk
* @param mixed $options
*
* @throws \Shoperti\Uploader\Exceptions\DisallowedFileException
* @throws \Shoperti\Uploader\Exceptions\RemoteFileException
*
* @return \Shoperti\Uploader\UploadResult
*/
public function uploadAs($path, $name, $disk = null);
public function uploadAs($path, $name, $disk = null, $options = []);
}
10 changes: 6 additions & 4 deletions src/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ public function __construct(
*
* @param string $path
* @param string|null $disk
* @param mixed $options
*
* @throws \Shoperti\Uploader\Exceptions\DisallowedFileException
* @throws \Shoperti\Uploader\Exceptions\RemoteFileException
*
* @return \Shoperti\Uploader\UploadResult
*/
public function upload($path = null, $disk = null)
public function upload($path = null, $disk = null, $options = [])
{
$processedFile = $this->fileProcessor->process($this->uploadedFile, $this->config);

Expand All @@ -100,7 +101,7 @@ public function upload($path = null, $disk = null)

try {
// put() may throw an \InvalidArgumentException
$wasMoved = $this->filesystem->disk($disk)->put($uploadPath, (string) $processedFile);
$wasMoved = $this->filesystem->disk($disk)->put($uploadPath, (string) $processedFile, $options);
$e = null;
} catch (Exception $e) {
$wasMoved = false;
Expand Down Expand Up @@ -128,13 +129,14 @@ public function upload($path = null, $disk = null)
* @param string $path
* @param string $name
* @param string|null $disk
* @param mixed $options
*
* @throws \Shoperti\Uploader\Exceptions\DisallowedFileException
* @throws \Shoperti\Uploader\Exceptions\RemoteFileException
*
* @return \Shoperti\Uploader\UploadResult
*/
public function uploadAs($path, $name, $disk = null)
public function uploadAs($path, $name, $disk = null, $options = [])
{
$processedFile = $this->fileProcessor->process($this->uploadedFile, $this->config);

Expand All @@ -148,7 +150,7 @@ public function uploadAs($path, $name, $disk = null)

try {
// put() may throw an \InvalidArgumentException
$wasMoved = $this->filesystem->disk($disk)->put($uploadPath, (string) $processedFile);
$wasMoved = $this->filesystem->disk($disk)->put($uploadPath, (string) $processedFile, $options);
$e = null;
} catch (Exception $e) {
$wasMoved = false;
Expand Down