Implements communication via HTTP request and response headers for Wildfire Protocols.
category | Zend |
---|---|
package | Zend_Wildfire |
subpackage | Channel |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Controller_Plugin_Abstract |
destroyInstance() : void
Primarily used for testing.
dispatchLoopShutdown() : void
inherited_from | \Zend_Controller_Plugin_Abstract::dispatchLoopShutdown() |
---|
dispatchLoopShutdown() : void
dispatchLoopStartup(\Zend_Controller_Request_Abstract $request) : void
\Zend_Controller_Request_Abstract
flush() : boolean
boolean
Returns TRUE if data was flushedgetInstance(boolean $skipCreate = false
) : \Zend_Wildfire_Channel_HttpHeaders
boolean
True if an instance should not be created
\Zend_Wildfire_Channel_HttpHeaders
getProtocol(string $uri) : object
string
The URI for the protocol
object
Returns the protocol instance for the diven URIgetRequest() : \Zend_Controller_Request_Abstract
inherited_from | \Zend_Controller_Plugin_Abstract::getRequest() |
---|
\Zend_Wildfire_Exception |
---|
\Zend_Controller_Request_Abstract
getRequest() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
$requestgetResponse() : \Zend_Controller_Response_Abstract
inherited_from | \Zend_Controller_Plugin_Abstract::getResponse() |
---|
\Zend_Wildfire_Exception |
---|
\Zend_Controller_Response_Abstract
getResponse() : \Zend_Controller_Response_Abstract
\Zend_Controller_Response_Abstract
$responseinit(string $class = null
) : \Zend_Wildfire_Channel_HttpHeaders
string
OPTIONAL Subclass of Zend_Wildfire_Channel_HttpHeaders
\Zend_Wildfire_Exception |
---|
\Zend_Wildfire_Channel_HttpHeaders
Returns the singleton Zend_Wildfire_Channel_HttpHeaders instanceisReady(boolean $forceCheckRequest = false
) : boolean
The channel is ready as long as the request and response objects are initialized, can send headers and the FirePHP header exists in the User-Agent.
If the header does not exist in the User-Agent, no appropriate client is making this request and the messages should not be sent.
A timing issue arises when messages are logged before the request/response objects are initialized. In this case we do not yet know if the client will be able to accept the messages. If we consequently indicate that the channel is not ready, these messages will be dropped which is in most cases not the intended behaviour. The intent is to send them at the end of the request when the request/response objects will be available for sure.
If the request/response objects are not yet initialized we assume if messages are logged, the client will be able to receive them. As soon as the request/response objects are availoable and a message is logged this assumption is challenged. If the client cannot accept the messages any further messages are dropped and messages sent prior are kept but discarded when the channel is finally flushed at the end of the request.
When the channel is flushed the $forceCheckRequest option is used to force a check of the request/response objects. This is the last verification to ensure messages are only sent when the client can accept them.
inherited_from | \Zend_Wildfire_Channel_Interface::isReady() |
---|
boolean
OPTIONAL Set to TRUE if the request must be checked
boolean
Returns TRUE if channel is ready.postDispatch(\Zend_Controller_Request_Abstract $request) : void
This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), a new action may be specified for dispatching.
\Zend_Controller_Request_Abstract
preDispatch(\Zend_Controller_Request_Abstract $request) : void
This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), the current action may be skipped.
\Zend_Controller_Request_Abstract
routeShutdown(\Zend_Controller_Request_Abstract $request) : void
Called after Zend_Controller_Front exits from the router.
\Zend_Controller_Request_Abstract
routeStartup(\Zend_Controller_Request_Abstract $request) : void
\Zend_Controller_Request_Abstract
setControllerPluginStackIndex(integer $index) : integer
integer
The index of the plugin in the stack
integer
The previous index.setRequest(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Plugin_Abstract
\Zend_Controller_Request_Abstract
\Zend_Controller_Plugin_Abstract
setResponse(\Zend_Controller_Response_Abstract $response) : \Zend_Controller_Plugin_Abstract
\Zend_Controller_Response_Abstract
\Zend_Controller_Plugin_Abstract
_initProtocol(string $uri) : object
string
The URI for the protocol to be initialized
\Zend_Wildfire_Exception |
---|
object
Returns the new initialized protocol instance_registerControllerPlugin() : void
$_controllerPluginStackIndex : integer
999
$_headerPrefix : string
'X-WF-'
$_instance : \Zend_Wildfire_Channel_HttpHeaders
null
$_protocols : array
null
$_request : \Zend_Controller_Request_Abstract
$_response : \Zend_Controller_Response_Abstract