From 750a0696d20faee8353a5a3466847c191feb5592 Mon Sep 17 00:00:00 2001 From: A7maDev Date: Mon, 23 May 2016 18:50:18 +0300 Subject: [PATCH 1/4] Create test.txt --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..345e6ae --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +Test From 775b1913a3c8e16cca17d5e6e5b6e4fc152a7ac2 Mon Sep 17 00:00:00 2001 From: A7maDev Date: Mon, 23 May 2016 20:06:54 +0300 Subject: [PATCH 2/4] Delete test.txt --- test.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index 345e6ae..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -Test From 073458cf62cda1ef0b57d19aba652915dd431f61 Mon Sep 17 00:00:00 2001 From: A7maDev Date: Mon, 23 May 2016 20:07:34 +0300 Subject: [PATCH 3/4] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5c696ef..544bacc 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "codesleeve/stapler", + "name": "a7madev/stapler", "description": "Elegant and simple ORM-based file upload package for php.", "keywords": ["ORM", "file", "upload", "S3", "AWS", "paperclip"], "license": "MIT", From 2477cda8f6f76c12df42e29adf101aa1e49f7c48 Mon Sep 17 00:00:00 2001 From: A7maDev Date: Tue, 24 May 2016 09:17:20 +0300 Subject: [PATCH 4/4] Update S3.php --- src/Storage/S3.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Storage/S3.php b/src/Storage/S3.php index fb97026..8177d55 100644 --- a/src/Storage/S3.php +++ b/src/Storage/S3.php @@ -65,17 +65,22 @@ public function path($styleName) return $this->attachedFile->getInterpolator()->interpolate($this->attachedFile->path, $this->attachedFile, $styleName); } - /** - * Remove an attached file. - * - * @param array $filePaths - */ - public function remove(array $filePaths) - { - if ($filePaths) { - $this->s3Client->deleteObjects(['Bucket' => $this->attachedFile->s3_object_config['Bucket'], 'Objects' => $this->getKeys($filePaths)]); - } +/** + * Remove an attached file. + * + * @param array $filePaths + */ +public function remove(array $filePaths) +{ + if ($filePaths) { + $this->s3Client->deleteObjects([ + 'Bucket' => $this->attachedFile->s3_object_config['Bucket'], + 'Delete' => [ + 'Objects' => $this->getKeys($filePaths) + ], + ]); } +} /** * Move an uploaded file to it's intended destination.