class StackedHttpKernel in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/stack/builder/src/Stack/StackedHttpKernel.php \Stack\StackedHttpKernel
Hierarchy
- class \Stack\StackedHttpKernel implements HttpKernelInterface, TerminableInterface
Expanded class hierarchy of StackedHttpKernel
1 string reference to 'StackedHttpKernel'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses StackedHttpKernel
File
- vendor/
stack/ builder/ src/ Stack/ StackedHttpKernel.php, line 10
Namespace
StackView source
class StackedHttpKernel implements HttpKernelInterface, TerminableInterface {
private $app;
private $middlewares = array();
public function __construct(HttpKernelInterface $app, array $middlewares) {
$this->app = $app;
$this->middlewares = $middlewares;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
return $this->app
->handle($request, $type, $catch);
}
public function terminate(Request $request, Response $response) {
$prevKernel = null;
foreach ($this->middlewares as $kernel) {
// if prev kernel was terminable we can assume this middleware has already been called
if (!$prevKernel instanceof TerminableInterface && $kernel instanceof TerminableInterface) {
$kernel
->terminate($request, $response);
}
$prevKernel = $kernel;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HttpKernelInterface:: |
constant | |||
HttpKernelInterface:: |
constant | |||
StackedHttpKernel:: |
private | property | ||
StackedHttpKernel:: |
private | property | ||
StackedHttpKernel:: |
public | function |
Handles a Request to convert it to a Response. Overrides HttpKernelInterface:: |
|
StackedHttpKernel:: |
public | function |
Terminates a request/response cycle. Overrides TerminableInterface:: |
|
StackedHttpKernel:: |
public | function |