I like this idea, ..., but have you thought if there is a backward compatible way of adding this behavior to the existing Db resource?

like

resources.db.multidb = 1
resources.db.multidb.default = "db1"

resources.db.db1.dbname =
resources.db.db1.params.xxx =
resources.db.db2.dbname =
resources.db.db2.params.xxx =

Just a thought.. what do you think?

Douglas Hammond wrote:

I believe the Zend_Application_Resource_Multidb should have a param to
register the dbname in the registry so that setting up classes like
Zend_Session_SaveHandler_DbTable can select what db to use.

Right now if you use multidb and use Zend_Application_Resource_Session with
Zend_Session_SaveHandler_DbTable you cannot specify via configuration only
to use one of the non-default dbs setup using MultiDb.

For example application.ini below will not work as db2 is not registered in
the zend_registry

resources.multidb.db1.dbname = "db1"
resources.multidb.db1.default = true
..

resources.multidb.db2.dbname = "db2"
...

resources.session.use_only_cookies = true
resources.session.remember_me_seconds = 864000
resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable"
resources.session.saveHandler.options.db = "db2"
resources.session.saveHandler.options.name = "session"
resources.session.saveHandler.options.primary = "id"
resources.session.saveHandler.options.modifiedColumn = "modified"
resources.session.saveHandler.options.dataColumn = "data"
resources.session.saveHandler.options.lifetimeColumn = "lifetime"

Reply via email to