2016-11-23 3 views
0

Dies ist das erste Mal, dass ich das CMF für Symfony2 mit dem SimpleCmsBundle verwendet habe und ich habe große Schwierigkeiten, es richtig einzurichten. Das Hauptproblem ich zu haben scheinen, ist die Tatsache, dass Lehre zu brechen, wenn ich den Cache löschen:CMF-Bündel, das Lehre bricht? Symfony 2.8

[Symfony \ Component \ Dependency Injection \ Exception \ ParameterNotFoundException] Sie haben einen nicht vorhandenen Parameter „angeforderte konnte nicht ermitteln Der Doctrine Manager ist entweder Docurine ist nicht konfiguriert oder ein Paket ist falsch konfiguriert.

Wenn ich mein CMF-Paket auskommentiert, bekomme ich diesen Fehler nicht. Hier ist meine config:

# 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' } 

Meine AppKernel.php Datei:

$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() 
); 

Soweit ich weiß, habe ich die minimal erforderliche Konfiguration hinzugefügt, aber ich muss etwas sonst fehlt es wäre sicherlich nicht Lehre beeinflussen?

Antwort

0

am Symfony CMF Standard Edition Sehen, Sie fehlt höchstwahrscheinlich die Aufnahme der DoctrinePHPCRBundle in your AppKernel:

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

und die entsprechenden doctrine_phpcr configuration:

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

Ich glaube, das zum Teil es war, aber ich glaube, mein Die Parameter mussten angepasst werden, damit ich die Konfiguration korrekt erstellen konnte. Ich habe mein Symfony-Projekt neu installiert und es jetzt mit dem PHPCRBundle funktioniert, danke! –