Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[dev] Incorrect usage of Horde_Db_Adapter in Factories

0 views
Skip to first unread message

Michael M Slusarz

unread,
Apr 24, 2013, 11:53:09 PM4/24/13
to
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 [slu...@horde.org]

--
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: dev-uns...@lists.horde.org

Jan Schneider

unread,
Apr 25, 2013, 5:43:04 AM4/25/13
to

Zitat von Michael M Slusarz <slu...@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/
0 new messages