I am trying to combine Symfony2, KnpGaufetteBundle and Amazon S3. From the KnpGaufette package, I got the xml definition for my configuration. But this is in xml and my configuration is in yml. And for some reason I canβt lower my head. How to define the following variables in yml? And what do they mean?
<service id="acme.s3" class="AmazonS3"> <argument type="collection"> <argument key="key">%acme.aws_key%</argument> <argument key="secret">%acme.aws_secret_key%</argument> </argument> </service> <service id="acme.s3.adapter" class="Gaufrette\Adapter\AmazonS3"> <argument type="service" id="acme.s3"></argument> <argument>%acme.s3.bucket_name%</argument> </service> <service id="acme.fs" class="Gaufrette\Filesystem"> <argument type="service" id="acme.s3.adapter"></argument> </service>
Full Solution Update
So, in order to actually make it work, we not only have to postpone the configuration in yml (which was solved by chmeliuk β thanks), but we also need to configure the cacert.pem file for curling. You can get the correct form here: http://curl.haxx.se/ca/cacert.pem
Now put this where you want, and then use the following lines with an extra certificate_authority entry:
services: acme.s3: class: AmazonS3 arguments: options: { key: %acme.aws_key%, secret: %acme.aws_secret_key%, certificate_authority: "pathWhereYouDidPutThisFile/cacert.pem" } acme.s3.adapter: class: Gaufrette\Adapter\AmazonS3 arguments: service: @acme.s3 bucket_name: %acme.s3.bucket_name% acme.fs: class: Gaufrette\Filesystem arguments: adapter: @acme.s3.adapter
This solves the CA Cert cURL Error 60 problem, which could otherwise occur.
source share