Runs an application invoking all the PSR7 middleware and the registered application.
string
Default class name for new event objects.
\Cake\Event\EventManagerInterface
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
\Cake\Core\HttpApplicationInterface
\Cake\Http\Runner
__construct(\Cake\Core\HttpApplicationInterface $app, ?\Cake\Http\Runner $runner)
Constructor
\Cake\Core\HttpApplicationInterface
$app The application to use.
\Cake\Http\Runner|null
$runner optional Application runner.
bootstrap()
Application bootstrap wrapper.
Calls the application's bootstrap()
hook. After the application the plugins are bootstrapped.
dispatchEvent(string $name, ?array $data, ?object $subject)
Wrapper for creating and dispatching events.
Returns a dispatched event.
string
$name Name of the event.
array|null
$data optional Any value you wish to be transported with this event to it can be read by listeners.
object|null
$subject optional The object that this event applies to ($this by default).
\Cake\Event\EventInterface
emit(\Psr\Http\Message\ResponseInterface $response, ?\Laminas\HttpHandlerRunner\Emitter\EmitterInterface $emitter)
Emit the response using the PHP SAPI.
\Psr\Http\Message\ResponseInterface
$response The response to emit
\Laminas\HttpHandlerRunner\Emitter\EmitterInterface|null
$emitter optional The emitter to use. When null, a SAPI Stream Emitter will be used.
getApp()
Get the current application.
\Cake\Core\HttpApplicationInterface
The application that will be run.
getEventManager()
Get the application's event manager or the global one.
\Cake\Event\EventManagerInterface
run(?\Psr\Http\Message\ServerRequestInterface $request, ?\Cake\Http\MiddlewareQueue $middlewareQueue)
Run the request/response through the Application and its middleware.
This will invoke the following methods:
\Psr\Http\Message\ServerRequestInterface|null
$request optional The request to use or null.
\Cake\Http\MiddlewareQueue
$middlewareQueue optional MiddlewareQueue or null.
\Psr\Http\Message\ResponseInterface
RuntimeException
setEventManager(\Cake\Event\EventManagerInterface $eventManager)
Set the application's event manager.
If the application does not support events, an exception will be raised.
\Cake\Event\EventManagerInterface
$eventManager The event manager to set.
$this
InvalidArgumentException
Default class name for new event objects.
string
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
\Cake\Event\EventManagerInterface
\Cake\Core\HttpApplicationInterface
\Cake\Http\Runner
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Http.Server.html