From c1ab0494ce212a8123c144b79d2e7f958d05fc40 Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Thu, 11 Jul 2019 16:55:43 +0200 Subject: [PATCH] fix --- StorageBundle/Adaptors/S3Storage.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/StorageBundle/Adaptors/S3Storage.php b/StorageBundle/Adaptors/S3Storage.php index 69f89f4..4ad420c 100644 --- a/StorageBundle/Adaptors/S3Storage.php +++ b/StorageBundle/Adaptors/S3Storage.php @@ -40,6 +40,11 @@ class S3Storage implements StorageAdaptor ]); } + public function getClient() + { + return $this->client; + } + public function mode($name) { if ($name == 'public') return self::MODE_PUBLIC; @@ -63,8 +68,10 @@ class S3Storage implements StorageAdaptor protected function getPrefix($prefix = null) { $ret = ''; - if (isset($this->config['path'])) { + if (isset($this->config['path']) && !empty($this->config['path'])) + { $ret = trim($this->config['path'], '/').'/'; + if (trim($ret) == '/') $ret = ''; } if (!is_null($prefix)) { $ret = ltrim($prefix, '/');