[dev] Incorrect usage of Horde_Db_Adapter in Factories

Michael M Slusarz slusarz at horde.org
Thu Apr 25 03:53:09 UTC 2013


There are a bunch of factories (e.g. ActiveSyncState, Cache, Lock,  
Perms, Prefs, Token) that use this call:

$this->_injector->getInstance('Horde_Db_Adapter')

to obtain the Horde_Db object.  However, this doesn't appear to be  
correct since this will ALWAYS return the Db object of the "base"  
horde configuration - it won't honor any overwritten configurations  
(i.e. via <configsql> tags in conf.xml files).

Shouldn't we instead be using something like:

$this->_injector->getInstance('Horde_Core_Factory_Db')->create($app, $package)

in order to use these overwritten configurations (e.g. Auth, SessionHandler)?

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list