/** * Sets the Piece_Unity_Service_Authentication_State object to the session. */ private function _prepareAuthenticationState() { $session = $this->context->getSession(); $authenticationState = $session->getAttribute(self::SESSION_KEY); if (is_null($authenticationState)) { $authenticationState = Piece_Unity_Service_Authentication_State::singleton(); $session->setAttributeByRef(self::SESSION_KEY, $authenticationState); $session->setPreloadCallback('_Interceptor_Authentication', array('Piece_Unity_Plugin_Factory', 'factory')); $session->addPreloadClass('_Interceptor_Authentication', 'Interceptor_Authentication'); } else { Piece_Unity_Service_Authentication_State::setInstance($authenticationState); } $this->_authenticationState = $authenticationState; }
/** * Sets the Piece_Unity_Service_Authentication_State object to the session. */ function _prepareAuthenticationState() { $session =& $this->_context->getSession(); $authenticationState =& $session->getAttribute($GLOBALS['PIECE_UNITY_Interceptor_Authentication_AuthenticationStateSessionKey']); if (is_null($authenticationState)) { $authenticationState =& Piece_Unity_Service_Authentication_State::singleton(); $session->setAttributeByRef($GLOBALS['PIECE_UNITY_Interceptor_Authentication_AuthenticationStateSessionKey'], $authenticationState); $session->setPreloadCallback('_Interceptor_Authentication', array('Piece_Unity_Plugin_Factory', 'factory')); $session->addPreloadClass('_Interceptor_Authentication', 'Interceptor_Authentication'); } else { Piece_Unity_Service_Authentication_State::setInstance($authenticationState); } $this->_authenticationState =& $authenticationState; }