Zend Framework
3.0
|
"Serve" incoming HTTP requests More...
Public Member Functions | |
__construct (callable $callback, ServerRequestInterface $request, ResponseInterface $response) | |
Constructor. | |
__get ($name) | |
Allow retrieving the request, response and callback as properties. | |
setEmitter (Response\EmitterInterface $emitter) | |
Set alternate response emitter to use. | |
listen (callable $finalHandler=null) | |
"Listen" to an incoming request | |
Static Public Member Functions | |
static | createServer (callable $callback, array $server, array $query, array $body, array $cookies, array $files) |
Create a Server instance. | |
static | createServerFromRequest (callable $callback, ServerRequestInterface $request, ResponseInterface $response=null) |
Create a Server instance from an existing request object. | |
"Serve" incoming HTTP requests
Given a callback, takes an incoming request, dispatches it to the callback, and then sends a response.
__construct | ( | callable | $callback, |
ServerRequestInterface | $request, | ||
ResponseInterface | $response | ||
) |
Constructor.
Given a callback, a request, and a response, we can create a server.
callable | $callback | |
ServerRequestInterface | $request | |
ResponseInterface | $response |
__get | ( | $name | ) |
Allow retrieving the request, response and callback as properties.
string | $name |
OutOfBoundsException | for invalid properties |
|
static |
Create a Server instance.
Creates a server instance from the callback and the following PHP environmental values:
callable | $callback | |
array | $server | |
array | $query | |
array | $body | |
array | $cookies | |
array | $files |
|
static |
Create a Server instance from an existing request object.
Provided a callback, an existing request object, and optionally an existing response object, create and return the Server instance.
If no Response object is provided, one will be created.
callable | $callback | |
ServerRequestInterface | $request | |
null | ResponseInterface | $response |
listen | ( | callable | $finalHandler = null | ) |
"Listen" to an incoming request
If provided a $finalHandler, that callable will be used for incomplete requests.
Output buffering is enabled prior to invoking the attached callback; any output buffered will be sent prior to any response body content.
null | callable | $finalHandler |
setEmitter | ( | Response\EmitterInterface | $emitter | ) |
Set alternate response emitter to use.
Response\EmitterInterface | $emitter |