PHPackages                             gourmet/filters - 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. [Framework](/categories/framework)
4. /
5. gourmet/filters

ActiveCakephp-plugin[Framework](/categories/framework)

gourmet/filters
===============

Dispatcher filters (middlewares) for CakePHP 3

v1.0.0(10y ago)102.8k2[1 PRs](https://github.com/gourmet/filters/pulls)MITPHP

Since Mar 27Pushed 10y ago2 watchersCompare

[ Source](https://github.com/gourmet/filters)[ Packagist](https://packagist.org/packages/gourmet/filters)[ Docs](https://github.com/gourmet/filters)[ RSS](/packages/gourmet-filters/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Filters
=======

[](#filters)

\[[![Build Status](https://camo.githubusercontent.com/c5713789535d996709d39e8450cbc388477bff011acae45241ec931c780657a7/68747470733a2f2f7472617669732d63692e6f72672f676f75726d65742f66696c746572732e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/c5713789535d996709d39e8450cbc388477bff011acae45241ec931c780657a7/68747470733a2f2f7472617669732d63692e6f72672f676f75726d65742f66696c746572732e7376673f6272616e63683d6d6173746572)\](\[[![Total Downloads](https://camo.githubusercontent.com/6918b75e7859f3515ee968f825611ef8e11df05861c30320187f58ea52677935/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f66696c746572732f646f776e6c6f6164732e737667)](https://camo.githubusercontent.com/6918b75e7859f3515ee968f825611ef8e11df05861c30320187f58ea52677935/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f66696c746572732f646f776e6c6f6164732e737667)\]([![License](https://camo.githubusercontent.com/4448dcdd0f4b3de514ab476cc87ef5c11470eac37728c8ac0868610ec5258c0d/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f66696c746572732f6c6963656e73652e737667)](https://packagist.org/packages/gourmet/filters)

Dispatcher filters (middlewares) for [CakePHP 3](http://cakephp.org).

**NOTE: This is the `master` branch, latest stable is [1.0](https://github.com/gourmet/filters/tree/1.0) branch.**

Install
-------

[](#install)

Using [Composer](http://getcomposer.org):

```
composer require gourmet/filters:1.1.x-dev

```

You then need to load the plugin. In `boostrap.php`, something like:

```
\Cake\Core\Plugin::load('Gourmet/Filters');
```

Usage
-----

[](#usage)

All the below examples happen in `bootstrap.php`.

### MaintenanceFilter

[](#maintenancefilter)

By default, this filter will look for the `ROOT/maintenance.html` file and if it exists, it will use it as the response.

```
DispatcherFactory::add('Gourmet/Filters.Maintenance');
```

You could customize the path like so:

```
DispatcherFactory::add('Gourmet/Filters.Maintenance', [
    'path' => '/absolute/path/to/maintenance/file.html'
]);
```

*You could for example do `echo 'Scheduled maintenance' > maintenance.html` and your site will automatically be set to maintenance mode with the message 'Scheduled maintenance'.*

### IpFilter

[](#ipfilter)

Restrict access to spefic IPs and/or ban other.

```
DispatcherFactory::add('Gourmet/Filters.Ip', [
    'allow' => [
        '127.0.0.1'
    ]
]);
```

or

```
DispatcherFactory::add('Gourmet/Filters.Ip', [
    'disallow' => [
        '127.0.0.1'
    ]
]);
```

### RobotsFilter

[](#robotsfilter)

This one provides a default `robots.txt` file for non-production environments. By default, it checks the 'APP\_ENV' environment variable and compares it's value to 'production'.

```
DispatcherFactory::add('Gourmet/Filters.Robots');
```

On all your non-production environments, `robots.txt` will look like this:

```
User-Agent: *
Disallow: /

```

and your pages' headers will include the `X-Robots-Tag` with 'noindex. nofollow, noarchive' flags.

You can customize all of that using the configuration keys: priority, when, key, value.

Patches &amp; Features
----------------------

[](#patches--features)

- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches

Bugs &amp; Feedback
-------------------

[](#bugs--feedback)

License
-------

[](#license)

Copyright (c) 2015, Jad Bitar and licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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 ~159 days

Total

3

Last Release

3751d ago

Major Versions

v0.1.0 → v1.0.02015-06-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb57ae849b67ade8d9c1e266bc2868183bbcf07fb6c66c2d45254a452272d54?d=identicon)[jadb](/maintainers/jadb)

---

Top Contributors

[![jadb](https://avatars.githubusercontent.com/u/33527?v=4)](https://github.com/jadb "jadb (9 commits)")

---

Tags

cakephpgourmet

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gourmet-filters/health.svg)

```
[![Health](https://phpackages.com/badges/gourmet-filters/health.svg)](https://phpackages.com/packages/gourmet-filters)
```

###  Alternatives

[cakephp/debug_kit

CakePHP Debug Kit

86514.0M138](/packages/cakephp-debug-kit)[cakephp/bake

Bake plugin for CakePHP

11211.2M158](/packages/cakephp-bake)[friendsofcake/bootstrap-ui

Bootstrap front-end framework support for CakePHP

3492.1M32](/packages/friendsofcake-bootstrap-ui)[cakephp/localized

CakePHP Localized Plugin

218595.6k5](/packages/cakephp-localized)[cakephp/acl

Acl Plugin for CakePHP framework

109553.9k15](/packages/cakephp-acl)[cakephp/elastic-search

An Elastic Search datasource and data mapper for CakePHP

86766.6k8](/packages/cakephp-elastic-search)

PHPackages © 2026

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