From: Michael M Slusarz Date: Mon, 4 Oct 2010 19:09:30 +0000 (-0600) Subject: Fix Horde_Cache_Session creation. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f3a6dc0c929f22a19ae083e1a2a9a078cf0349e3;p=horde.git Fix Horde_Cache_Session creation. Not sure how else to do this, but with the recent compress config option added to horde/Cache, this is the only way to pickup this option. Also, this was broken since theoretically use_memorycache could have been set to true but creating Horde_Cache_Session this way would not have honored that config setting. --- diff --git a/framework/Core/lib/Horde/Core/Factory/Cache.php b/framework/Core/lib/Horde/Core/Factory/Cache.php index d79822acd..7539fc37e 100644 --- a/framework/Core/lib/Horde/Core/Factory/Cache.php +++ b/framework/Core/lib/Horde/Core/Factory/Cache.php @@ -42,6 +42,25 @@ class Horde_Core_Factory_Cache $driver = 'Null'; } + return $this->_create($driver, $injector); + } + + /** + * Return the Horde_Cache_Session:: instance. + * + * @return Horde_Cache_Session + * @throws Horde_Cache_Exception + */ + public function createSession(Horde_Injector $injector) + { + return $this->_create('Session', $injector); + } + + /** + * @see create() + */ + private function _create($driver, $injector) + { $params = Horde::getDriverConfig('cache', $driver); if (isset($GLOBALS['conf']['cache']['default_lifetime'])) { $params['lifetime'] = $GLOBALS['conf']['cache']['default_lifetime']; @@ -80,6 +99,8 @@ class Horde_Core_Factory_Cache return new $classname($params); } + /** + */ protected function _driverToClassname($driver) { $driver = ucfirst(basename($driver)); diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index baa334f6c..0fcdb5658 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -296,6 +296,10 @@ class Horde_Registry 'Horde_Core_Factory_Cache', 'create', ), + 'Horde_Cache_Session' => array( + 'Horde_Core_Factory_Cache', + 'createSession', + ), 'Horde_Controller_Request' => array( 'Horde_Core_Factory_Request', 'create',