2014-01-17 38 views
4

我试图按here所述安装SonataMediaBundle
安装完毕后,我收到此错误:ManagerInterface找不到SonataMediaBundle

PHP Fatal error: Interface 'Sonata\CoreBundle\Model\ManagerInterface' not found in /var/www/prj/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Model/MediaManagerInterface.php on line 20 

有一个Sonata\CoreBundle\Entity\ManagerInterface但没有Sonata\CoreBundle\Model\ManagerInterface
问题是什么?

回答

3

最近更新CoreBundleAdminBundle并更改了此名称空间。直到它的解决可以确保您使用的是最新版本通过在这些行你composer.json

"require": { 
    ... 
    "sonata-project/core-bundle": "dev-master", 
    "sonata-project/media-bundle": "dev-master" 
} 
+0

这是给我一个错误'ContextErrorException:运行时注意:索纳塔宣言\ UserBundle \控制器\这个RegistrationController :: registerAction ()应该与FOS \ UserBundle \ Controller \ RegistrationController :: registerAction()兼容如何解决这个问题? – Link14

+0

这似乎是一个不同的问题正在跟踪[这里](https://github.com/sonata- project/SonataUserBundle/pull/311)。解决这类问题的方法可能是使用稳定版本而不是'dev-master'。 – albertedevigo

+0

我不明白如果我不明白'使用'dev-master',我得到了OP发布的错误。你介意在你的composer.json中给我所有的'sonata-project'声明吗?我想我可能在某个地方有一个错误的版本。 – Link14

1

更新您的composer.json从索纳塔的沙箱; https://github.com/sonata-project/sandbox/blob/2.3-develop/composer.json#L45-L63

"sonata-project/easy-extends-bundle": "[email protected]", 
    "sonata-project/seo-bundle": "[email protected]", 
    "sonata-project/admin-bundle": "[email protected]", 
    "sonata-project/doctrine-orm-admin-bundle": "[email protected]", 
    "sonata-project/block-bundle": "[email protected]", 
    "sonata-project/media-bundle": "[email protected]", 
    "sonata-project/user-bundle": "[email protected]", 
    "sonata-project/cache-bundle": "[email protected]", 
    "sonata-project/page-bundle": "[email protected]", 
    "sonata-project/core-bundle": "[email protected]", 

关注于核心束“:[email protected]“,