-
Notifications
You must be signed in to change notification settings - Fork 100
Fuel Framework
FuelPHP is a simple, flexible, community driven PHP web framework.
Use PHP Composer:
composer require shieldon/shieldon ^2
In your fuel/app/bootstrap.php
, after this line:
require COREPATH.'bootstrap.php';
Add the following code:
Example:
/*
|--------------------------------------------------------------------------
| Run The Shieldon Firewall
|--------------------------------------------------------------------------
|
| Shieldon Firewall will watch all HTTP requests coming to your website.
|
*/
if (isset($_SERVER['REQUEST_URI'])) {
// This directory must be writable.
// We put it in the `fuel/app/tmp` directory.
$storage = __DIR__ . '/tmp/shieldon_firewall';
$firewall = new \Shieldon\Firewall\Firewall();
$firewall->configure($storage);
$firewall->controlPanel('/firewall/panel');
$response = $firewall->run();
if ($response->getStatusCode() !== 200) {
$httpResolver = new \Shieldon\Firewall\HttpResolver();
$httpResolver($response);
}
}
Please make sure that $storage
directory is existed and writable.
Now, modify your fuel/app/config/routes.php
and add the following code.
Example:
'firewall/panel(:everything)' => function () {
$panel = new \Shieldon\Firewall\Panel();
$panel->entry();
},
The full example might look like this.
Example:
return array(
'_root_' => 'welcome/index', // The default route
'_404_' => 'welcome/404', // The main 404 route
'hello(/:name)?' => array('welcome/hello', 'name' => 'hello'),
'firewall/panel(:everything)' => function () {
$panel = new \Shieldon\Firewall\Panel();
$panel->entry();
},
);
That's it.
You can access the Firewall Panel by /firewall/panel
, to see the page, go to this URL in your browser.
https://yoursite.com/firewall/panel
The default login is shieldon_user
and password
is shieldon_pass
. After logging in the Firewall Panel, the first thing you need to do is to change the login and password.
Shieldon Firewall will start watching your website if it get enabled in Deamon
setting section, make sure you have set up the settings correctly.
- Author: Terry L. from Taiwan.
- Website: shieldon.io
- GitHub repository: github.com/terrylinooo/shieldon
- WordPress plugin: wordpress.org/plugins/wp-shieldon/
Docs: Laravel, Symfony, CodeIgniter, CakePHP, Yii, Zend, Slim, Fat-Free, Fuel, PHPixie