diff --git a/CHANGELOG.md b/CHANGELOG.md index 435c350..e0cae80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +## 1.2.0 + +* Added the ability to create protocol-relative URLs with the S3 and CloudFront link view helpers +* Added TravisCI configuration +* Added PHPUnit as a development dependency + ## 1.1.0 * Added ZF2 session save handler for Amazon DynamoDB diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5fe0173..f05a4fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,14 +5,15 @@ community on this module and recognize your expertise. We welcome the submission ## What you should keep in mind -1. The SDK is released under the [Apache license][license]. Any code you submit will be released under that license. For - substantial contributions, we may ask you to sign a [Contributor License Agreement (CLA)][cla]. +1. The AWS SDK for PHP and the AWS SDK ZF2 Module are released under the [Apache license][license]. Any code you submit + will be released under that license. For substantial contributions, we may ask you to sign a [Contributor + License Agreement (CLA)][cla]. 2. We follow the [PSR-0][], [PSR-1][], and [PSR-2][] recommendations from the [PHP Framework Interop Group][php-fig]. Please submit code that follows these standards. The [PHP CS Fixer][cs-fixer] tool can be helpful for formatting your code. 3. We maintain a high percentage of code coverage in our unit tests. If you make changes to the code, please add or update unit tests as appropriate. -4. If your pull request does not conform to the PSR standards, include adequate tests, or pass the TravisCI build, we +4. If your pull request fails to conform to the PSR standards, include adequate tests, or pass the TravisCI build, we may ask you to update your pull request before we accept it. We also reserve the right to deny any pull requests that do not align with our standards or goals. 5. If you would like to implement support for a significant feature, please talk to us beforehand to avoid any @@ -20,12 +21,12 @@ community on this module and recognize your expertise. We welcome the submission ## Running the unit tests -The AWS SDK for PHP is unit tested using PHPUnit. You can run the unit tests of the SDK after copying -phpunit.xml.dist to phpunit.xml: +The AWS SDK ZF2 Module uses unit tests built for PHPUnit. You can run the unit tests of the SDK after copying +`phpunit.xml.dist` to `phpunit.xml`: cp phpunit.xml.dist phpunit.xml -Next, you need to install the dependencies of the SDK using Composer: +Next, you need to install the dependencies of the module (including the AWS SDK for PHP) using Composer: composer.phar install diff --git a/Module.php b/Module.php index c2aac04..333b845 100644 --- a/Module.php +++ b/Module.php @@ -23,6 +23,8 @@ */ class Module implements ConfigProviderInterface { + const VERSION = '1.2.0'; + /** * {@inheritdoc} */ diff --git a/README.md b/README.md index 97333bf..9b8132f 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,8 @@ Starting from version 1.0.2, the AWS SDK ZF2 Module now provides two view helper Amazon CloudFront resources. > **Note:** Both of the view helpers generate URLs with an HTTPS scheme by default. This is ideal for security, but -please keep in mind that Amazon CloudFront charges more for HTTPS requests. You can turn SSL off by calling the -`setUseSsl` method on both helpers. +please keep in mind that Amazon CloudFront charges more for HTTPS requests. You can use a different scheme (e.g., HTTP) +by calling the `setScheme` method on either helper. #### S3Link View Helper diff --git a/src/Aws/Factory/AwsFactory.php b/src/Aws/Factory/AwsFactory.php index 7642e98..2e9ed50 100644 --- a/src/Aws/Factory/AwsFactory.php +++ b/src/Aws/Factory/AwsFactory.php @@ -18,6 +18,7 @@ use Aws\Common\Aws; use Aws\Common\Client\UserAgentListener; +use Aws\Module; use Guzzle\Common\Event; use Guzzle\Service\Client; use Zend\ServiceManager\FactoryInterface; @@ -58,7 +59,7 @@ public function onCreateClient(Event $event) $clientConfig = $event['client']->getConfig(); $commandParams = $clientConfig->get(Client::COMMAND_PARAMS) ?: array(); $clientConfig->set(Client::COMMAND_PARAMS, array_merge_recursive($commandParams, array( - UserAgentListener::OPTION => 'ZF2/' . Version::VERSION, + UserAgentListener::OPTION => 'ZF2/' . Version::VERSION . ' ZFMOD/' . Module::VERSION, ))); } } diff --git a/tests/Aws/Tests/Factory/AwsFactoryTest.php b/tests/Aws/Tests/Factory/AwsFactoryTest.php index 2d35580..d131c3f 100644 --- a/tests/Aws/Tests/Factory/AwsFactoryTest.php +++ b/tests/Aws/Tests/Factory/AwsFactoryTest.php @@ -52,6 +52,6 @@ public function testCanAddZf2ToUserAgent() $clientParams = $client->getConfig()->get(Client::COMMAND_PARAMS); $this->assertArrayHasKey(UserAgentListener::OPTION, $clientParams); - $this->assertStringStartsWith('ZF2', $clientParams[UserAgentListener::OPTION]); + $this->assertRegExp('/ZF2\/.+ZFMOD\/.+/', $clientParams[UserAgentListener::OPTION]); } }