我试图让 LiipImagine 在我的 Symfony2 项目中运行,使用 KnpGraufette Bundle 来访问我的 Amazon AWS S3 帐户。
现在我已经可以访问 S3、存储和加载数据以及所有内容了。我可以使用 LiipImagine 过滤本地图像。到目前为止,一切都很好。
现在我使用以下配置将我的 gaufrette/s3 服务和 LiipImagine 粘合在一起,如本教程中所示。
services:
  amazonS3:
    class: AmazonS3
    arguments:
      options:
        key: '%aws_key%'
        secret: '%aws_secret_key%'
        certificate_authority: '%kernel.root_dir%/config/cacert.pem'
  gaufrette.amazonS3_adapter:
    class: Gaufrette\Adapter\AmazonS3
    arguments:
      service: '@amazonS3'
      bucket_name: '%aws_bucketname%'
  gaufrette.amazonS3.fileSystemService:
    class: Gaufrette\Filesystem
    arguments:
      adapter: '@gaufrette.amazonS3_adapter'
  our.fs.dataloader.s3:
    class: Liip\ImagineBundle\Imagine\Data\Loader\FileSystemLoader
    arguments:
      - "@liip_imagine"
      - "@gaufrette.amazonS3.fileSystemService"
    tags:
      - { name: 'liip_imagine.data.loader', loader: 'gaufrette.amazonS3.fileSystemService' }
liip_imagine:
  filter_sets:
    s3_clientsbar:
      data_loader: 'our.fs.dataloader.s3'
      filters:
        thumbnail: { size: [50, 50], mode: outbound, allow_upscale: true }
使用 LiipImagine 过滤 S3 资源时,出现以下错误:
ErrorException: Catchable Fatal Error: Argument 2 passed to Liip\ImagineBundle\Imagine\Data\Loader\FileSystemLoader::__construct() must be an array, object given, called in
测试我的过滤的代码是这样的:
$imagemanagerResponse = $this->container->get('liip_imagine.controller')->filterAction($this->getRequest(),'the-actual-existing-loadable-aws-id' , 's3_clientsbar');
另外:版主可以添加Tag Gaufrette、KnpGaufrette 或KnpGaufretteBundle 吗?