Download the PHP package gourmet/filters without Composer
On this page you can find all versions of the php package gourmet/filters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gourmet/filters
More information about gourmet/filters
Files in gourmet/filters
Package filters
Short Description Dispatcher filters (middlewares) for CakePHP 3
License MIT
Homepage https://github.com/gourmet/filters
Informations about the package filters
Filters
[](https://travis-ci.org/gourmet/filters [](https://packagist.org/packages/gourmet/filters
Dispatcher filters (middlewares) for CakePHP 3.
NOTE: This is the master
branch, latest stable is 1.0 branch.
Install
Using Composer:
You then need to load the plugin. In boostrap.php
, something like:
Usage
All the below examples happen in bootstrap.php
.
MaintenanceFilter
By default, this filter will look for the ROOT/maintenance.html
file and if it exists,
it will use it as the response.
You could customize the path like so:
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
Restrict access to spefic IPs and/or ban other.
or
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'.
On all your non-production environments, robots.txt
will look like this:
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 & 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 & Feedback
http://github.com/gourmet/filters/issues
License
Copyright (c) 2015, Jad Bitar and licensed under The MIT License.