Unlike other frameworks, Fat-Free is an extremely lightweight PHP framework.

Firewall in FatFree Framework


Use PHP Composer:

composer require shieldon/shieldon

This will also install dependencies required for Shieldon:


Assuming your code is supposed to look like this:


require dirname(__DIR__) . '/vendor/autoload.php';

$f3 = \Base::instance();
$f3->route('GET /',
    function() {
        echo 'Hello, world!';


1. Initialize Shieldon Firewall

After this line:

require dirname(__DIR__) . '/vendor/autoload.php';

Add the following code:


// Prevent error when running in CLI environment.
if (isset($_SERVER['REQUEST_URI'])) {

    // This directory must be writable.
    $storage = dirname($_SERVER['SCRIPT_FILENAME']) . '/../shieldon_firewall';

    $firewall = new \Shieldon\Firewall\Firewall();
    $response = $firewall->run();

    if ($response->getStatusCode() !== 200) {
        $httpResolver = new \Shieldon\Firewall\HttpResolver();


Please create a writable directory named shieldon_firewall in the directory above. Shieldon Firewall will store data in this directory.

2. Define a Route for the Firewall Panel


$f3->route('GET|POST /firewall/panel*', function() {
    $panel = new \Shieldon\Firewall\Panel();

That's it!

Now, you can access the Firewall Panel using the following URL:


The default login is shieldon_user, and the password is shieldon_pass. After logging into the Firewall Panel, the first thing you should do is change the login and password.

If Shieldon Firewall is enabled in the Daemon setting section, it will start monitoring your website. Make sure you have correctly set up the settings.