質問

Symfony 2.1.2プロジェクトにSonataAdminBundleを設定し、正しく機能します。今、私はSonatidiaBundleを設定しようとしていますが、このエラーを入手します:

==> php app/console sonata:easy-extends:generate SonataMediaBundle



  [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]  
  You have requested a non-existent parameter "doctrine.connections".         
.

ドキュメントを示すようにconfig.ymlにconfig.ymlにコピーしました。あなたはそれを見ることができます: http://pastebin.com/wys11net

任意の助けや手がかり?

事前感あり

役に立ちましたか?

解決

Looks like you're missing the Connections node inside the Doctrine > DBAL's node, aswell the specification of a default connection (among multiple connections, if that would be the case). An example of the right template would be like

doctrine:
    dbal:
        default_connection:   default
        connections:
            default:
                driver:   %database_driver%
                host:     %database_host%
                port:     %database_port%
                dbname:   %database_name%
                user:     %database_user%
                password: %database_password%
                charset:  UTF8

他のヒント

I just ran into this problem as well, and found that the "connections" node is not actually required in the config (see http://symfony.com/doc/current/reference/configuration/doctrine.html#doctrine-dbal-configuration ... you only need the connections node when you have multiple connections).

In my case, it was that I had the SonataCacheBundle in the AppKernel.php file before Doctrine. Doctrine sets the "doctrine.connections" parameter when Doctrine initializes, so if you try to access it in SonataCacheBundle before Doctrine has initialized then "doctrine.connections" is not in the container yet.

Reordering the entries in AppKernel.php fixed the issue for me.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top