Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable database configuration in symfony2

Tags:

php

symfony

The new app I'm working on is using Symfony2. There is no database connection to use. Instead it's build upon many web service calls. Under Symfony/app/config, I would like to remove all database_* entries but when I do that, I get a

ParameterNotFoundException: You have requested a non-existent parameter "database_driver"

The error is obvious. But how do I decouple and remove the database configs from the app itself?

like image 507
user1218776 Avatar asked Jun 18 '12 21:06

user1218776


1 Answers

Remove DoctrineBundle initialisation from your AppKernel and doctrine configuration from your app/config/config*.yml files. It registers doctrine configuration in the container. That's why container complains if you try removing the parameters (bundle is enabled and looks for those parameters).

In latest versions of Symfony you'll also need to remove the doctrine channel from monolog configuration in config_dev.yml (remove the channels: ["doctrine"] line).

like image 162
Jakub Zalas Avatar answered Sep 21 '22 00:09

Jakub Zalas