I thought as much Matthew, for anyone who has this same issue below is a
potential solution though I am undecided as to how good it is. A better
solution would be to override all the methods maybe rather than setting the
superglobals however the Zend_Controller_Request_Http is not implemented
particularly nicely and because it is accessing the superglobals in lots of
different places it would mean overriding most of the methods.
<?php
class Custom_Request_HttpPersistent extends Zend_Controller_Request_Http
{
protected $_persistentGET = array();
protected $_persistentPOST = array();
protected $_persistentCOOKIE = array();
protected $_persistentSERVER = array();
protected $_persistentENV = array();
protected $_serialized = false;
public function __sleep()
{
if(!$this->_serialized)
{
// this is first serialize so persist the environment
state
$this->_persistentGET = $_GET;
$this->_persistentPOST = $_POST;
$this->_persistentCOOKIE = $_COOKIE;
$this->_persistentSERVER = $_SERVER;
$this->_persistentENV = $_ENV;
$this->_serialized = true;
}
return array_keys(get_object_vars($this));
}
/**
* Initialises the environment so this request will act as it did when
it
was first
* serialised
*/
public function initEnvironment()
{
$_GET = $this->_persistentGET;
$_POST = $this->_persistentPOST;
$_COOKIE = $this->_persistentCOOKIE;
$_SERVER = $this->_persistentSERVER;
$_ENV = $this->_persistentENV;
}
}
?>
--
View this message in context:
http://www.nabble.com/Zend_Controller_Request_Http-persistence---storing-in-session-problem-tp19287751p19289288.html
Sent from the Zend Framework mailing list archive at Nabble.com.