ZF-7997: Automatically initialize multiple databases...
I think that it would be nice to introduce the ability to have Zend_Application automatically initialize multiple databases.
For example, one can define a database in a configuration file that will drive the initialization of a Zend_Db adapter. (See here: http://framework.zend.com/manual/en/…)
I suspect that there are a handful of situations where an application will use multiple database connections. Sometimes completely different hosts may be used. Sometimes the same database may be used, but as a different user. Sometimes the same host will be used, but with a different database. I'm guessing what kinds of situations people might be using, however there is an application that I work on that has some data on an "internal" server and other data on an "external" server. Both databases need to be used.
I realize that it's quite easy to set up multiple db adapters, each with different connection parameters, but one loses the ability to use the configuration file to drive this....a feature I very much enjoy and want to continue to use.
I noticed that there was a semi-related "new feature" issue already in the tracker system: http://framework.zend.com/issues/browse/ZF-6719. This issue is asking for the ability to have multiple configuration files, allowing, among other things, the ability to clean up and separate configuration information into smaller, focused files....kind of like Apache's HTTP conf files of late. I can see a focused DB configuration file that would simply declare which database(s) to connect to automatically. The ability to name each database and declare one as a default would be great.
So, that's it, in a nutshell. If, for some reason, someone doesn't understand what I'm talking about, please let me know and I'll try to explain it better.