简体   繁体   English

没有FOS用户捆绑包,可以使用Sonata新闻捆绑包吗?

[英]Can or cannot Sonata News Bundle be used without FOS User Bundle?

I'm trying to set up my new Sonata based environment, but due to some internal business requirements, we cannot use FOS User Bundle neather Sonata User Bundle. 我正在尝试建立新的基于Sonata的环境,但是由于一些内部业务需求,我们无法使用FOS User Bundle和neather Sonata User Bundle。

But I would like to use Sonata News Bundle, however after the initial setup of composer dependency and appKenrnel dependency I noticed a internal bundle dependency: 但是我想使用Sonata News Bundle,但是在最初设置composer依赖项和appKenrnel依赖项之后,我注意到了一个内部bundle依赖项:

/vendor/sonata-project/news-bundle/Resources/config/admin.xml /vendor/sonata-project/news-bundle/Resources/config/admin.xml

<services>
    <service id="sonata.news.admin.post" class="%sonata.news.admin.post.class%">
        <tag name="sonata.admin" manager_type="orm" group="sonata_blog" label="posts"  label_catalogue="%sonata.news.admin.post.translation_domain%" label_translator_strategy="sonata.admin.label.strategy.underscore" />
        <argument />
        <argument>%sonata.news.admin.post.entity%</argument>
        <argument>%sonata.news.admin.post.controller%</argument>

        <call method="setUserManager">
            <argument type="service" id="fos_user.user_manager" />
        </call>

Error from console after composer install: 安装composer后控制台出现错误:

[Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException] The service "sonata.news.admin.post" has a dependency on a non-existent service "fos_user.user_manager". [Symfony \\ Component \\ DependencyInjection \\ Exception \\ ServiceNotFoundException]服务“ sonata.news.admin.post”具有对不存在的服务“ fos_user.user_manager”的依赖。

Has anybody managed to use News Bundle without FOS User Bundle? 有没有人设法在没有FOS用户捆绑包的情况下使用新闻捆绑包?

Yes this could be possible: 是的,这是可能的:

SonataNewsBundle refers to Sonata\\UserBundle\\Model\\UserManagerInterface that extends FOS\\UserBundle\\Model\\UserManagerInterface , but this is only Php documentation, so it should work without (or with a dummy one you could write). SonataNewsBundle指的是扩展FOS\\UserBundle\\Model\\UserManagerInterface Sonata\\UserBundle\\Model\\UserManagerInterface ,但这只是Php文档,因此它应该在没有(或使用您可以编写的虚拟文件)下工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM