We’ve got a really big project that’s being built in Symfony 2. It’s going to be hosted on Amazon Web Services (AWS), so I looked into integrating S3 into our build. The KnpLabsGaufretteBundle seems to be the right choice for the job due to its clean abstraction, but getting it to actually run was a bit trickier than it should have been.
The Gaufrette documentation is, well, a bit lacking. Here’s how I got it to work:
"knplabs/knp-gaufrette-bundle": "0.2.*@dev", "amazonwebservices/aws-sdk-for-php": "dev-master",
and run composer update.
knp_gaufrette: adapters: amazon: amazon_s3: amazon_s3_id: amazon.s3 bucket_name: %amazon.bucket% create: true filesystems: amazon: adapter: amazon stream_wrapper: protocol: s3 filesystems: - amazon
services: amazon.s3: class: AmazonS3 arguments: options: { key: %amazon.key%, secret: %amazon.secret%, certificate_authority: false, default_cache_config: true }
amazon.key: YOUR_KEY amazon.secret: YOUR_SECRET amazon.bucket: YOUR_BUCKET
$this->get('knp.gaufrette.filesystem_map')->get('amazon');
Hi! Thanks for post.
I followed this steps, but got such error: “There is no extension able to load the configuration for “knp_gaufrette” (in /home/vladshut/projects/itezo/app/config/config.yml)”
Do You know how to solve this problem? Thanks in advance.
The author forgot this step:
Add this to your AppKernel.php:
new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle()
Instructions here are more up to date – I used a bit of both:
https://github.com/KnpLabs/KnpGaufretteBundle
Hello blogger, i must say you have very interesting content here.
Your website can go viral. You need initial traffic boost only.
How to get it? Search for: Mertiso’s tips go viral