Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ matrix:
allow_failures:
- php: hhvm

install: travis_retry composer install --no-interaction --prefer-source
install: travis_retry composer install --no-interaction

script: vendor/bin/phpunit
script: make test

74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# CHANGELOG

## next release

* Added test coverage for version 5.2 of both Lumen and Laravel.

## 3.0.3 - 2015-09-18

* Added support for configuring credentials with environmental variables, a ini
file at `~/.aws/credentials`, or with Ec2 instance profiles instead of
requiring their inclusion in the `aws.php` config file.

## 3.0.3 - 2015-08-10

* Removed usage of a dev dependency

## 3.0.1 - 2015-08-05

* Provide version information to SDK user agent

## 3.0.0 - 2015-06-10

* Service provider is now compatible with Laravel 5.1 and Version 3 of the AWS
SDK for PHP.

## 2.0.1 - 2015-06-10

* Service provider is now compatible with Lumen

## 2.0.0 - 2015-03-12

* Updated the service provider to work with Laravel 5.

## 1.1.2 - 2015-02-13

* Added alias to support DI from container.

## 1.1.1 - 2014-05-12

* Updated default module config file to make it more compatible with environment
credentials

## 1.1.0 - 2013-09-03

* Added package-level config that can be published with Artisan
* Updated config loading logic to support package-level config
* Updated config loading logic to support AWS SDK for PHP config files via the
`config_file` key
* Updated code, tests, and the README to support the config refactoring
* This module is now following [semver](http://semver.org/)

## 1.0.4 - 2013-06-20

* Added support for the AWS facade
* Updated `composer.json` to require only specific components of Laravel
* Updated `composer.json` to require version 2.2+ of the AWS SDK for PHP

## 1.0.3 - 2013-04-25

* Update Composer dependencies to work with newer version of the AWS SDK for PHP
and Laravel

## 1.0.2 - 2013-03-11

* Fixed an issue with config retrieval

## 1.0.1 - 2013-03-07

* Improved usage instructions in the README
* Fixed logic for retrieving Laravel version

## 1.0.0 - 2013-02-13

* Initial release.
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
test: test-laravel test-lumen

test-laravel:
composer require laravel/framework
vendor/bin/phpunit
make uninstall-laravel

test-lumen:
composer require laravel/lumen-framework
vendor/bin/phpunit
make uninstall-lumen

uninstall-illuminate:
rm -rf vendor/laravel
rm -rf vendor/illuminate

uninstall-laravel: uninstall-illuminate
composer remove laravel/framework

uninstall-lumen: uninstall-illuminate
composer remove laravel/lumen-framework

# Ensures that the TAG variable was passed to the make command
check-tag:
$(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))

# Creates a release but does not push it. This task updates the changelog
# with the TAG environment variable, replaces the VERSION constant, ensures
# that the source is still valid after updating, commits the changelog and
# updated VERSION constant, creates an annotated git tag using chag, and
# prints out a diff of the last commit.
tag: check-tag test
@echo Tagging $(TAG)
chag update $(TAG)
sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/AwsServiceProvider.php
php -l src/AwsBundle.php
git commit -a -m '$(TAG) release'
chag tag
@echo "Release has been created. Push using 'make release'"
@echo "Changes made in the release commit"
git diff HEAD~1 HEAD
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
"illuminate/support": "~5.1"
},
"require-dev": {
"laravel/framework": "~5.1",
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.0|~5.0"
},
"suggest": {
"laravel/framework": "To test the Laravel bindings",
"laravel/lumen-framework": "To test the Lumen bindings"
},
"autoload": {
"psr-4": { "Aws\\Laravel\\": "src/" }
Expand Down
9 changes: 7 additions & 2 deletions src/AwsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php namespace Aws\Laravel;

use Aws\Sdk;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;

/**
* AWS SDK for PHP service provider for Laravel applications
Expand All @@ -26,8 +28,10 @@ public function boot()
{
$source = realpath(__DIR__ . '/../config/aws.php');

if (class_exists('Illuminate\Foundation\Application', false)) {
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
$this->publishes([$source => config_path('aws.php')]);
} elseif ($this->app instanceof LumenApplication) {
$this->app->configure('aws');
}

$this->mergeConfigFrom($source, 'aws');
Expand All @@ -41,7 +45,8 @@ public function boot()
public function register()
{
$this->app->singleton('aws', function ($app) {
$config = $app['config']->get('aws');
$config = $app->make('config')->get('aws');

return new Sdk($config);
});

Expand Down
22 changes: 6 additions & 16 deletions tests/AwsServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

use Aws\Laravel\AwsFacade as AWS;
use Aws\Laravel\AwsServiceProvider;
use Illuminate\Config\Repository;
use Illuminate\Foundation\Application;
use Illuminate\Container\Container;

class AwsServiceProviderTest extends \PHPUnit_Framework_TestCase
abstract class AwsServiceProviderTest extends \PHPUnit_Framework_TestCase
{

public function testFacadeCanBeResolvedToServiceInstance()
Expand Down Expand Up @@ -61,24 +60,16 @@ public function testVersionInformationIsProvidedToSdkUserAgent()
}

/**
* @return Application
* @return Container
*/
private function setupApplication()
{
// Create the application such that the config is loaded.
$app = new Application();
$app->setBasePath(sys_get_temp_dir());
$app->instance('config', new Repository());

return $app;
}
abstract protected function setupApplication();

/**
* @param Application $app
* @param Container $app
*
* @return AwsServiceProvider
*/
private function setupServiceProvider(Application $app)
private function setupServiceProvider(Container $app)
{
// Create and register the provider.
$provider = new AwsServiceProvider($app);
Expand All @@ -87,5 +78,4 @@ private function setupServiceProvider(Application $app)

return $provider;
}

}
26 changes: 26 additions & 0 deletions tests/LaravelAwsServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php namespace Aws\Laravel\Test;

use Illuminate\Config\Repository;
use Illuminate\Foundation\Application;

class LaravelAwsServiceProviderTest extends AwsServiceProviderTest
{
public function setUp()
{
if (!class_exists(Application::class)) {
$this->markTestSkipped();
}

parent::setUp();
}

protected function setupApplication()
{
// Create the application such that the config is loaded.
$app = new Application();
$app->setBasePath(sys_get_temp_dir());
$app->instance('config', new Repository());

return $app;
}
}
26 changes: 26 additions & 0 deletions tests/LumenAwsServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
namespace Aws\Laravel\Test;

use Illuminate\Config\Repository;
use Laravel\Lumen\Application;

class LumenAwsServiceProviderTest extends AwsServiceProviderTest
{
public function setUp()
{
if (!class_exists(Application::class)) {
$this->markTestSkipped();
}

parent::setUp();
}

protected function setupApplication()
{
// Create the application such that the config is loaded.
$app = new Application(sys_get_temp_dir());
$app->instance('config', new Repository());

return $app;
}
}