_saveHandler = $saveHandler; return $this; } /** * Get session save handler * * @return Zend_Session_SaveHandler_Interface */ public function getSaveHandler() { if (!$this->_saveHandler instanceof Zend_Session_SaveHandler_Interface) { if (is_array($this->_saveHandler)) { if (!array_key_exists('class', $this->_saveHandler)) { throw new Zend_Application_Resource_Exception('Session save handler class not provided in options'); } if (array_key_exists('options', $this->_saveHandler)) { $options = $this->_saveHandler['options']; } $this->_saveHandler = $this->_saveHandler['class']; $this->_saveHandler = new $this->_saveHandler($options); } elseif (is_string($this->_saveHandler)) { $this->_saveHandler = new $this->_saveHandler(); } if (!$this->_saveHandler instanceof Zend_Session_SaveHandler_Interface) { throw new Zend_Application_Resource_Exception('Invalid session save handler'); } } return $this->_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); } if ($this->_saveHandler !== null) { Zend_Session::setSaveHandler($this->getSaveHandler()); } } }