我尝试使用Symfony CMF Sandbox安装SonataMediaBundle并在安装后出现此异常
Catchable fatal error:
Argument 2 passed to Sonata\CoreBundle\Model\BaseManager::__construct()
must implement interface Doctrine\Common\Persistence\ManagerRegistry,
instance of Sonata\DoctrinePHPCRAdminBundle\Model\ModelManager given,
called in cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php on line 7986
and defined in cmf-sandbox/vendor/sonata-project/core-bundle/Model/BaseManager.php on line 41
看起来像版本冲突,但是捆绑包是通过composer安装的,没有冲突,我也尝试安装旧版本/新版本,但没有结果。
我尝试phpcr和mongodb,是一样的。
composer.json:
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"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.*",
"symfony-cmf/symfony-cmf": "1.1.*",
"symfony-cmf/simple-cms-bundle": "1.1.*",
"symfony-cmf/search-bundle": "1.0.*",
"symfony-cmf/create-bundle": "1.1.*",
"symfony-cmf/seo-bundle":"1.0.*",
"jackalope/jackalope-doctrine-dbal": "1.1.*",
"jackalope/jackalope-jackrabbit": "1.1.*",
"doctrine/doctrine-bundle": "1.2.*",
"doctrine/data-fixtures": "1.0.*",
"doctrine/doctrine-cache-bundle": "1.0.*",
"sonata-project/cache-bundle": "2.1.*",
"sonata-project/doctrine-phpcr-admin-bundle": "1.1.*",
"sonata-project/jquery-bundle": "1.8.3",
"symfony-cmf/block-bundle": "1.1.*",
"eko/feedbundle": "1.0.*",
"lunetics/locale-bundle": "2.2.*",
"liip/imagine-bundle": "0.21.*",
"wjzijderveld/check-bundles": "1.0.*",
"helios-ag/fm-elfinder-bundle": "1.4.*",
"sonata-project/media-bundle": "2.3.*@dev"
config.yml:
# cmf configuration
doctrine_phpcr:
# configure the PHPCR session
session:
backend: %phpcr_backend%
workspace: %phpcr_workspace%
username: %phpcr_user%
password: %phpcr_pass%
# enable the ODM layer
odm:
auto_mapping: true
mappings:
SonataMediaBundle:
prefix: Sonata\MediaBundle\PHPCR
auto_generate_proxy_classes: %kernel.debug%
locales:
en:
- de
- fr
sonata_media:
default_context: default
db_driver: doctrine_phpcr #doctrine_orm # or doctrine_mongodb
contexts:
default: # the default context is mandatory
providers:
- sonata.media.provider.dailymotion
- sonata.media.provider.youtube
- sonata.media.provider.image
- sonata.media.provider.file
formats:
small: { width: 100 , quality: 70}
big: { width: 500 , quality: 70}
cdn:
server:
path: /uploads/media # http://media.sonata-project.org/
filesystem:
local:
directory: %kernel.root_dir%/../web/uploads/media
create: false
答案 0 :(得分:2)
获得Sonata Bundles的正确版本有点棘手,我们刚刚发布了1.1并尝试通过使依赖关系更加明确来改进一些事情。你能再试一次吗?