简体   繁体   中英

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.

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:

/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:

[Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException] The service "sonata.news.admin.post" has a dependency on a non-existent service "fos_user.user_manager".

Has anybody managed to use News Bundle without FOS User Bundle?

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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