Created
May 23, 2016 09:23
-
-
Save ylastapis/e392ac72543504b05b8a332a935e8b9c to your computer and use it in GitHub Desktop.
AWS 3 with Symfony2 and Gaufrette
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"knplabs/gaufrette": "dev-master", | |
"knplabs/knp-gaufrette-bundle": "dev-master", | |
"aws/aws-sdk-php": "dev-master" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
knp_gaufrette: | |
adapters: | |
sylius_image: | |
aws_s3: | |
service_id: app.amazon_s3 | |
bucket_name: "%amazon_s3.bucket_name%" | |
app: | |
amazon_s3: | |
key: "%amazon_s3.key%" | |
secret: "%amazon_s3.secret%" | |
region: "%amazon_s3.region%" | |
version: "%amazon_s3.version%" | |
bucket_name: "%amazon_s3.bucket_name%" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\DependencyInjection; | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
class Configuration implements ConfigurationInterface | |
{ | |
public function getConfigTreeBuilder() | |
{ | |
$treeBuilder = new TreeBuilder(); | |
$rootNode = $treeBuilder->root('app'); | |
$rootNode | |
->children() | |
->arrayNode('amazon_s3') | |
->children() | |
->scalarNode('key')->defaultValue('EDITME')->end() | |
->scalarNode('secret')->defaultValue('EDITME')->end() | |
->scalarNode('region')->defaultValue('YOUR_BUCKET_REGION')->end() | |
->scalarNode('version')->defaultValue('2006-03-01')->end() | |
->scalarNode('bucket_name')->defaultValue('YOUR_BUCKET_NAME')->end() | |
->end() | |
->end() | |
->end(); | |
return $treeBuilder; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is auto-generated during the composer install | |
parameters: | |
amazon_s3.key: EDITME | |
amazon_s3.secret: EDITME | |
amazon_s3.region: YOUR_BUCKET_REGION | |
amazon_s3.version: '2006-03-01' | |
amazon_s3.bucket_name: YOUR_BUCKET_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app.amazon_s3: | |
class: Aws\S3\S3Client | |
factory: [ Aws\S3\S3Client , factory] | |
arguments: | |
- | |
region: "%amazon_s3.region%" | |
version: "%amazon_s3.version%" | |
credentials: | |
key: "%amazon_s3.key%" | |
secret: "%amazon_s3.secret%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update of https://gist.github.com/phpfour/6533329 with latest AWS 3 SDK (changed from amazonwebservices/aws-sdk-for-php to aws/aws-sdk-php)