alxsad / stack-ip-firewall
Stack middleware for filtering IP
v1.0
2015-01-19 13:18 UTC
Requires
- php: >=5.4
- lstrojny/functional-php: 1.0.*@dev
- piwik/network: dev-master
- symfony/http-foundation: ~2.6
- symfony/http-kernel: ~2.6
Requires (Dev)
- phpunit/phpunit: ~4.4
- stack/builder: ~1.0
This package is not auto-updated.
Last update: 2024-11-19 04:47:55 UTC
README
IpFirewall middleware
Stack middleware to filtering IP.
Intallation
The recommended way to install this library is through Composer:
{ "require": { "alxsad/stack-ip-firewall": "~1.0" } }
Usage
use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__ . '/../app/bootstrap.php.cache'; require_once __DIR__ . '/../app/AppKernel.php'; $kernel = new AppKernel('dev', true); $kernel->loadClassCache(); $stack = (new Stack\Builder())->push('Alxsad\Stack\IpFirewall', [ '192.168.1.*', '192.168.10.10', ]); $kernel = $stack->resolve($kernel); Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
License
This library is released under the MIT License. See the bundled LICENSE file for details.