PHP code example of alxsad / stack-ip-firewall

1. Go to this page and download the library: Download alxsad/stack-ip-firewall library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alxsad / stack-ip-firewall example snippets


use Symfony\Component\HttpFoundation\Request;

$loader = = 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);