2016-11-23 103 views
0

這是我第一次用SimpleCmsBundle爲Symfony2使用CMF,並且我有很多困難正確設置它。主要的問題我似乎已經是當我清除緩存,這種理論打破了這一事實:CMF捆綁打破主義? Symfony 2.8

[Symfony的\分量\ DependencyInjection \異常\ ParameterNotFoundException] 您已請求不存在的參數「無法確定 原則管理器。未配置Doctrine或配置錯誤 。「。

當我註釋掉我的CMF包包含時,我不會收到此錯誤。下面是我的配置:

# Doctrine Configuration 
doctrine: 
    dbal: 
     driver: pdo_mysql 
     host:  "%database_host%" 
     port:  "%database_port%" 
     dbname: "%database_name%" 
     user:  "%database_user%" 
     password: "%database_password%" 
     charset: UTF8 
     # if using pdo_sqlite as your database driver: 
     # 1. add the path in parameters.yml 
     #  e.g. database_path: "%kernel.root_dir%/data/data.db3" 
     # 2. Uncomment database_path in parameters.yml.dist 
     # 3. Uncomment next line: 
     #  path:  "%database_path%" 

    orm: 
     auto_generate_proxy_classes: "%kernel.debug%" 
     naming_strategy: doctrine.orm.naming_strategy.underscore 
     auto_mapping: true 

# Swiftmailer Configuration 
swiftmailer: 
    transport: "%mailer_transport%" 
    host:  "%mailer_host%" 
    username: "%mailer_user%" 
    password: "%mailer_password%" 
    spool:  { type: memory } 

knp_menu: 
    twig: true 

cmf_core: 
    persistence: 
     phpcr: 
      enabled: true 

sonata_block: 
    default_contexts: [sonata_page_bundle] 
    blocks: 
     sonata.admin.block.admin_list: 
      contexts: [admin] 

     #sonata.admin_doctrine_orm.block.audit: 
     # contexts: [admin] 

     sonata.block.service.text: 
     sonata.block.service.rss: 

     # Some specific block from the SonataMediaBundle 
     #sonata.media.block.media: 
     #sonata.media.block.gallery: 
     #sonata.media.block.feature_media: 

     # Some block with different templates 
     #acme.demo.block.demo: 
     # templates: 
     #  - { name: 'Simple', template: 'AcmeDemoBundle:Block:demo_simple.html.twig' } 
     #  - { name: 'Big', template: 'AcmeDemoBundle:Block:demo_big.html.twig' } 

AppKernel.php文件:

$bundles = array(
    new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), 
    new Symfony\Bundle\SecurityBundle\SecurityBundle(), 
    new Symfony\Bundle\TwigBundle\TwigBundle(), 
    new Symfony\Bundle\MonologBundle\MonologBundle(), 
    new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), 
    new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
    new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
    new AppBundle\AppBundle(), 
    new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(), 
    new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(), 
    new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(), 
    new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(), 

    // Dependencies of the CmfMenuBundle 
    new Knp\Bundle\MenuBundle\KnpMenuBundle(), 

    // Dependencies of the CmfBlockBundle 
    new Sonata\CoreBundle\SonataCoreBundle(), 
    new Sonata\BlockBundle\SonataBlockBundle() 
); 

據我所知,我已經添加所需的最低配置,但我必須失去了一些東西,否則它肯定不會影響教義?

回答

0

望着Symfony CMF Standard Edition,你最有可能缺少DoctrinePHPCRBundle in your AppKernel列入:

$bundles = array(
     // ... 
     new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(), 
    ); 

及相關doctrine_phpcr configuration

# app/config/config.yml 
    doctrine_phpcr: 
     odm: ~ 
+0

我認爲這在一定程度了,但我想我的需要調整參數,以便我可以正確創建配置。我最終重新安裝了我的Symfony項目,現在與PHPCRBundle合作,謝謝! –