diff --git a/src/Dmyers/Storage/Adapter/AmazonS3.php b/src/Dmyers/Storage/Adapter/AmazonS3.php index 0d50cc3..f4e6bc7 100644 --- a/src/Dmyers/Storage/Adapter/AmazonS3.php +++ b/src/Dmyers/Storage/Adapter/AmazonS3.php @@ -22,6 +22,12 @@ public function __construct() throw new \RuntimeException('AmazonS3 secret config required.'); } + $region = $this->config('region'); + + if (empty($region)) { + throw new \RuntimeException('AmazonS3 region config required.'); + } + $bucket = $this->config('bucket'); if (empty($bucket)) { @@ -33,6 +39,7 @@ public function __construct() $this->client = S3Client::factory(array( 'key' => $key, 'secret' => $secret, + 'region' => $region, )); } @@ -247,4 +254,4 @@ protected function computePath($path) return S3Client::encodeKey($path); } -} \ No newline at end of file +} diff --git a/src/config/config.php b/src/config/config.php index b750aaf..90907be 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -25,6 +25,7 @@ 'amazons3' => array( 'key' => '', 'secret' => '', + 'region' => 'us-east-1', 'bucket' => '', 'acl' => 'public-read', ), @@ -53,4 +54,4 @@ */ 'route_path' => false, -); \ No newline at end of file +);