_saveHandlerClass = $saveHandler; return $this; } private function _initSaveHandler() { if (is_array($this->_saveHandlerClass)) { if (!array_key_exists('class', $this->_saveHandlerClass)) { throw new Zend_Application_Resource_Exception('Session save handler class not provided in options'); } if (array_key_exists('options', $this->_saveHandlerClass)) { $options = $this->_saveHandlerClass['options']; } $saveHandler = $this->_saveHandlerClass['class']; $saveHandler = new $saveHandler($options); } elseif (is_string($this->_saveHandlerClass)) { $saveHandler = new $this->_saveHandlerClass(); } if (!$saveHandler instanceof Zend_Session_SaveHandler_Interface) { throw new Zend_Application_Resource_Exception('Invalid session save handler'); } $this->_saveHandler = $saveHandler; } /** * Defined by Zend_Application_Resource_Resource * * @return void */ public function init() { $options = array_change_key_case($this->getOptions(), CASE_LOWER); if (isset($options['savehandler'])) { unset($options['savehandler']); } if (count($options) > 0) { Zend_Session::setOptions($options); } $this->_initSaveHandler(); if ($this->_saveHandler !== null) { Zend_Session::setSaveHandler($this->_saveHandler); } } }