Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public function s3CreatFileAction(Request $request) {
  2.  
  3. $filesystem = $this->get('knp_gaufrette.filesystem_map')->get('profile_photos');
  4. $filesystem->write('test.txt', 'hello world');
  5.  
  6. [...]
  7. }
  8.  
  9. $filesystem = $this->get('knp_gaufrette.filesystem_map')->get('profile_photos');
  10. $file = $filesystem->get('test.txt');
  11.  
  12. #app/config/config.yml
  13.  
  14. services:
  15. acme.aws_s3.client:
  16. class: AwsS3S3Client
  17. factory_class: AwsS3S3Client
  18. factory_method: 'factory'
  19. arguments:
  20. -
  21. key: %amazon_s3.key%
  22. secret: %amazon_s3.secret%
  23.  
  24. # knp_gaufrette
  25. knp_gaufrette:
  26. adapters:
  27. profile_photos:
  28. aws_s3:
  29. service_id: 'acme.aws_s3.client'
  30. bucket_name: 'myBucket'
  31. options:
  32. directory: 'myDirectory'
  33. acl: 'public-read'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement