class BanMiddleware implements HttpKernelInterface (View source)

Provides a HTTP middleware to implement IP based banning.

Properties

protected HttpKernelInterface $httpKernel

The decorated kernel.

protected BanIpManagerInterface $banIpManager

The ban IP manager.

Methods

__construct(HttpKernelInterface $http_kernel, BanIpManagerInterface $manager)

Constructs a BanMiddleware object.

Response
handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE)

{@inheritdoc}

Details

__construct(HttpKernelInterface $http_kernel, BanIpManagerInterface $manager)

Constructs a BanMiddleware object.

Parameters

HttpKernelInterface $http_kernel

The decorated kernel.

BanIpManagerInterface $manager

The ban IP manager.

Response handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE)

{@inheritdoc}

Parameters

Request $request
$type
$catch

Return Value

Response