From 91353e7104b244e7566977329914670935e043c2 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Tue, 15 Sep 2015 13:47:09 -0400 Subject: [PATCH 1/5] remove credentials if blank, causing the SDK to use ec2 role --- src/AwsServiceProvider.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AwsServiceProvider.php b/src/AwsServiceProvider.php index 3af207f..daacd86 100644 --- a/src/AwsServiceProvider.php +++ b/src/AwsServiceProvider.php @@ -41,7 +41,12 @@ public function boot() public function register() { $this->app->singleton('aws', function ($app) { - return new Sdk($app['config']->get('aws')); + $config = $app['config']->get('aws'); + if ( is_null ( $app['config']->get('aws')['credentials']['key'] ) && is_null( $app['config']->get('aws')['credentials']['secret'] ) ) + { + unset( $config['credentials'] ); + } + return new Sdk($config); }); $this->app->alias('aws', 'Aws\Sdk'); From 16398c73e3dbae10c82fe75c7c76fe0de60e2238 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Tue, 15 Sep 2015 14:04:33 -0400 Subject: [PATCH 2/5] fixing cs issues --- src/AwsServiceProvider.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/AwsServiceProvider.php b/src/AwsServiceProvider.php index daacd86..0c99b49 100644 --- a/src/AwsServiceProvider.php +++ b/src/AwsServiceProvider.php @@ -41,11 +41,10 @@ public function boot() public function register() { $this->app->singleton('aws', function ($app) { - $config = $app['config']->get('aws'); - if ( is_null ( $app['config']->get('aws')['credentials']['key'] ) && is_null( $app['config']->get('aws')['credentials']['secret'] ) ) - { - unset( $config['credentials'] ); - } + $config = $app['config']->get('aws'); + if (is_null($app['config']->get('aws')['credentials']['key']) && is_null($app['config']->get('aws')['credentials']['secret'])) { + unset($config['credentials']); + } return new Sdk($config); }); From a5b543b93b4fb158b7a58ad3b9af9d7b973eb06a Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Tue, 15 Sep 2015 16:58:47 -0400 Subject: [PATCH 3/5] removing credentials from default config, restoring serviceprovider --- config/aws.php | 5 +---- src/AwsServiceProvider.php | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config/aws.php b/config/aws.php index 03bb41a..8f86c66 100644 --- a/config/aws.php +++ b/config/aws.php @@ -16,10 +16,7 @@ | http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html | */ - 'credentials' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - ], + 'region' => env('AWS_REGION', 'us-east-1'), 'version' => 'latest', 'ua_append' => [ diff --git a/src/AwsServiceProvider.php b/src/AwsServiceProvider.php index 0c99b49..1eb8e73 100644 --- a/src/AwsServiceProvider.php +++ b/src/AwsServiceProvider.php @@ -42,9 +42,6 @@ public function register() { $this->app->singleton('aws', function ($app) { $config = $app['config']->get('aws'); - if (is_null($app['config']->get('aws')['credentials']['key']) && is_null($app['config']->get('aws')['credentials']['secret'])) { - unset($config['credentials']); - } return new Sdk($config); }); From 1f883c7e4939ffe45b42ab1833db116b73fff14f Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 16 Sep 2015 12:12:58 -0400 Subject: [PATCH 4/5] changing test to allow hhvm failures --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 907edd1..3810144 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,10 @@ php: sudo: false +matrix: + allow_failures: + - php: hhvm + install: travis_retry composer install --no-interaction --prefer-source script: vendor/bin/phpunit From 744ebd0ce94ae2a4f301788e38e53f65258945ce Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 16 Sep 2015 12:15:45 -0400 Subject: [PATCH 5/5] removing tabs --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3810144..9bcf7bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ php: sudo: false matrix: - allow_failures: - - php: hhvm + allow_failures: + - php: hhvm install: travis_retry composer install --no-interaction --prefer-source