KnpGaufretteBundle
KnpGaufretteBundle copied to clipboard
stream writer can't write folders to S3
I have the following config:
knp_gaufrette:
adapters:
amazon:
amazon_s3:
amazon_s3_id: site_store.s3
bucket_name: %site_store.bucket_name%
create: true
filesystems:
amazon:
adapter: amazon
stream_wrapper:
protocol: s3
filesystems:
- amazon
assetic:
read_from: %cdn_path_prod%
write_to: %cdn_path_prod%
however when I try to dump all of the assets it always gives me:
[RuntimeException]
Unable to create directory s3://amazon/css
I've looked at the following thread (https://github.com/Cybernox/AmazonWebServicesBundle) and it says to return true in the mkdir function, I did that however it's still erroring. Any idea?
+1
+1
I didn't used KnpGaufretteBundle more to write at S3, my solution: http://stackoverflow.com/a/26146562/1983572 maybe don't need to create the StreamWrapperS3
in the answer as a service, just instantiate it getting parameters with $this->container->getParameter('name')
This works somewhat if you switch to aws sdk 3.0 and change the aws initialization like so:
aws_s3.client:
class: Aws\S3\S3Client
factory_class: Aws\S3\S3Client
factory_method: 'factory'
arguments:
-
credentials:
key: %amazon_aws_key%
secret: %amazon_aws_secret_key%
region: 'us-east-1'
version: 'latest'
The only issue now is the content-types get set wrong