[dev] Incorrect usage of Horde_Db_Adapter in Factories
Jan Schneider
jan at horde.org
Thu Apr 25 09:43:04 UTC 2013
Zitat von Michael M Slusarz <slusarz at horde.org>:
> 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)?
Yes.
--
Jan Schneider
The Horde Project
http://www.horde.org/
More information about the dev
mailing list