gpt4 book ai didi

symfony - Sonata media Liip Imagine Integration 奏鸣曲媒体 Liip Imagine Integration

转载 作者:行者123 更新时间:2023-12-02 16:10:33 25 4
gpt4 key购买 nike

我正在尝试按照集成说明使用 Liip Imagine 与 Sonata Media 生成缩略图:

http://sonata-project.org/bundles/media/master/doc/reference/extra.html#liip-imagine-bundle-integration

但我无法同时获得引用图像和缩略图的正确路径。我认为我的问题在于这个配置点:

cdn:
# The CDN part must point to the base root of your application with a valid htaccess to match non existant
# file. The non existant image will be send to the SonataMediaBundle:Media:liipImagineFilter controller.
server:
path: http://mydomain.com

使用索纳塔媒体的原始配置

cdn:
path: /uploads/media

引用图像 url 可以,但拇指不会生成,它们的 url 如下:

/uploads/media/app_dev.php/uploads/media/cache/product/0001/01/18_product_small.jpg

以下集成说明:

cdn:
path: http://myapp.test

其中 myapp.test 使用 symfony 的默认 htaccess 指向我的基本根应用程序,使用公共(public) url 正确生成拇指,如下所示:

http://myapp.test/app_dev.php/uploads/media/cache/product/0001/01/18_product_small.jpg

但引用图像的公共(public)网址是:

http://myapp.test/product/0001/01/113835a6853a.jpeg

不存在,正确的网址是:

http://myapp.test/uploads/media/product/0001/01/113835a6853a.jpeg

所有这些网址都是从奏鸣曲管理员复制的。

遵循 liipimagine 集成说明的部分可能需要触摸其他内容才能获取正确的引用图像 URL?

我正在使用:

    "php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/intl-bundle": "dev-master",
"sonata-project/media-bundle": "dev-master",
"sonata-project/core-bundle": "dev-master",
"a2lix/translation-form-bundle": "dev-master",
"knplabs/doctrine-behaviors": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"stfalcon/tinymce-bundle": "dev-master",
"tilleuls/ckeditor-sonata-media-bundle": "dev-master",
"egeloen/ckeditor-bundle": "2.*",
"gedmo/doctrine-extensions": "dev-master",
"friendsofsymfony/jsrouting-bundle": "1.*@dev",
"asm/translation-loader-bundle": "~1.0",
"lunetics/locale-bundle": "2.2.*",
"craue/twigextensions-bundle": "~1.0",
"sonata-project/formatter-bundle": "dev-master",
"pixassociates/sortable-behavior-bundle": "dev-master",
"liip/imagine-bundle": "dev-master"

最佳答案

将路径设置为空字符串对我有用:

cdn:
server:
path: ''

我在谷歌讨论中找到了这个解决方案,但是我丢失了引用。我不知道为什么奏鸣曲媒体项目上的说明不正确。

我的项目中的包版本:

  • 奏鸣曲项目/admin-bundle 2.3.1
  • 奏鸣曲项目/媒体包 2.3.1
  • liip/imagine-bundle 0.21.1

注意确保您使用的是 0.* 版本的 liipimaginebundle,因为 1.* 版本不起作用(至少开箱即用)

关于symfony - Sonata media Liip Imagine Integration 奏鸣曲媒体 Liip Imagine Integration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22404712/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com