DefaultServer
class DefaultServer implements ServerInterface, ApplicationAwareInterface (View source)
Traits
Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface
Properties
protected Application | $app | from ApplicationAwareTrait | |
protected callable | $dispatcher | ||
protected StackInterface | $stack |
Methods
Response
handleRequest(Request $request)
Take a request and pass it through middleware, then return the response
Details
setApplication(Application $app)
Setter method for the application
__construct(DispatcherInterface $dispatcher, StackInterface $stack)
Server constructor.
ServerInterface
setDispatcher(DispatcherInterface $dispatcher)
Set the dispatcher this server uses.
A dispatcher is used to handle the final conversion from request to response function ($request, $response) : Response;
ServerInterface
addMiddleware(MiddlewareInterface $middleware, int $priority = 10)
Add a middleware to the stack
ServerInterface
removeMiddleware(MiddlewareInterface $middleware)
Remove a middleware from the stack
Response
handleRequest(Request $request)
Take a request and pass it through middleware, then return the response