PHPackages                             triopsi/banned-tool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. triopsi/banned-tool

ActiveCakephp-plugin[Authentication &amp; Authorization](/categories/authentication)

triopsi/banned-tool
===================

Ban tool plugin for CakePHP. A quick way to ban IP addresses.

v1.2.0(2y ago)0246MITPHPPHP &gt;=8.2

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/triopsi/banned-tool)[ Packagist](https://packagist.org/packages/triopsi/banned-tool)[ RSS](/packages/triopsi-banned-tool/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

Ban IP Address plugin for CakePHP
=================================

[](#ban-ip-address-plugin-for-cakephp)

A quick way to ban IP addresses. It`s a plugin for CakePHP 4.x.

 [![](banned-tool.png)](banned-tool.png)

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require triopsi/banned-tool

```

Database migration
------------------

[](#database-migration)

Run the following command in the CakePHP console to create the tables using the Migrations plugin:

```
bin/cake migrations migrate -p BannedTool
```

Load Plugin
-----------

[](#load-plugin)

Via the Load task you are able to load plugins in your config/bootstrap.php. You can do this by running:

```
bin/cake plugin load BannedTool

```

### Manually

[](#manually)

Put this in the application.php in the bootstrap method:

```
$this->addPlugin('BannedTool');
```

Install middleware
------------------

[](#install-middleware)

To use the tool you need to add the following code snippet to your Application.php in the middleware section. eIt is not always recommended to put the Banned Middleware first.

```
use BannedTool\Middleware\BannedMiddleware;
use Cake\View\View;

public function middleware( MiddlewareQueue $middlewareQueue ): MiddlewareQueue {
    ...
    ->add(
        new BannedMiddleware(
            array(
            'className' => View::class,
            'templatePath' => 'Error',
            'statusCode' => 403,
            'templateLayout' => false,
            'templateFileName' => 'banned',
            'templateExtension' => '.php',
            'contentType' => 'text/html',
            )
        )
        ...
)
```

Customizing
-----------

[](#customizing)

Make sure you have a template file in `'templates' . DS . 'Error' . DS` named `banned.php`.

Configs:

- 'className' =&gt; View::class,
- 'templatePath' =&gt; 'Error',
- 'statusCode' =&gt; 403,
- 'templateLayout' =&gt; false,
- 'templateFileName' =&gt; 'banned',
- 'templateExtension' =&gt; '.php',
- 'contentType' =&gt; 'text/html'

Those can be used to adjust the content of the banned page.

Ban Component
-------------

[](#ban-component)

This component adds functionality on top:

- Add ip Address to the banlist
- Remove ip Address from the banlist
- Check if the IP address is in the banlist
- List all banned ip addresses

### How to setup

[](#how-to-setup)

```
// In your App Controller Class (src/Controller/AppController)
public function initialize() {
    ...
    $this->loadComponent('BannedTool.Banned');
}
```

Ban Commands
------------

[](#ban-commands)

This should be the preferred way of enabling and disabling the maintenance mode for your application.

Commands

- add ban &lt;ip\_addresses&gt;
- rm ban &lt;ip\_addresses&gt;
- list bans

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Total

4

Last Release

931d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.2

v1.2.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5702824?v=4)[Triopsi](/maintainers/triopsi)[@triopsi](https://github.com/triopsi)

---

Top Contributors

[![triopsi](https://avatars.githubusercontent.com/u/5702824?v=4)](https://github.com/triopsi "triopsi (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/triopsi-banned-tool/health.svg)

```
[![Health](https://phpackages.com/badges/triopsi-banned-tool/health.svg)](https://phpackages.com/packages/triopsi-banned-tool)
```

###  Alternatives

[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131240.2k13](/packages/dereuromark-cakephp-tinyauth)[cakephp/debug_kit

CakePHP Debug Kit

86314.7M170](/packages/cakephp-debug-kit)[cakedc/users

Users Plugin for CakePHP

525928.0k20](/packages/cakedc-users)[cakephp/bake

Bake plugin for CakePHP

11212.0M201](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M43](/packages/dereuromark-cakephp-ide-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
