ZF-6256: Unknown option: savehandler = Array when using Zend_Application_Resource_Session
Description
Reproduce: Send session configuration to Zend_Application like this:
$application = new Zend_Application(
APPLICATION_ENVIRONMENT,
array(
'resources' => array(
'session' => array(
'saveHandler' => array(
'class' => 'Zend_Session_SaveHandler_DbTable',
'options' => array(
'name' => 'session',
'primary' => 'id',
'modifiedColumn' => 'modified',
'dataColumn' => 'data',
'lifetimeColumn' => 'lifetime',
),
),
),
),
)
);
Throws an Exception: Zend_Session_Exception: Unknown option: savehandler = Array in Zend\Session.php on line 220
Comments
Posted by Chris Jones (leeked) on 2009-04-16T18:47:58.000+0000
The problem is caused because the key 'saveHandler' being sent to Zend_Session::setOptions() and it not being apart of one of either Zend_Session::$_defaultOptions or Zend_Session::$_localOptions.
My fix is relatively simple; pull the options and remove 'savehandler' from it before sending to Zend_Session::setOptions().
I'm thinking this isn't the most elegant solution, but it does work.
Posted by Chris Jones (leeked) on 2009-04-16T18:52:46.000+0000
Last .patch was for the wrong codebase. This is the correct patch.
Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T05:21:05.000+0000
Patch applied to trunk in r14957 -- thanks!