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?
Symfony2 is integrated with Doctrine2 by default. You cannnot remove the configuration, unless you set another integration bundle.
It would be effortless if you simply leave these fields empty. A connection to the database would be made only when the application requires it, which, in your case, should not happen.
Remove DoctrineBundle initialisation from your AppKernel and
doctrine
configuration from yourapp/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 thechannels: ["doctrine"]
line).