0
當我使用compser.phar使一個Symfony2的項目更新:ParameterNotFoundException:您已請求不存在的參數「database_accounts_driver」
php composer.phar update
我有這樣的錯誤,當我更新後運行該項目:
ParameterNotFoundException: You have requested a non-existent parameter "database_accounts_driver".
這裏是我的config.yml:
# Doctrine Configuration
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
accounts:
driver: "%database_accounts_driver%"
host: "%database_accounts_host%"
port: "%database_accounts_port%"
dbname: "%database_accounts_name%"
user: "%database_accounts_user%"
password: "%database_accounts_password%"
charset: UTF8
也是我parameter.yml:
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
最後我appkernel:
$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 Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
任何想法?
注:考慮到,也許如果你寫在parameters.yml那些行帳戶,然後更新作曲家,如果你沒有在parameters.yml.dist中寫出這些行,也許他們可以消失(因爲composer按照parameters.yml.dist的結構更新parameters.yml) –