A Zend Framework module that helps you to deal with rate limit.
- In your
composer.json
file, add:
"repositories": [
{
"url": "https://github.com/inmediam/zf-rate-limit.git",
"type": "git"
}
],
- In the terminal, run:
composer require inmediam/zf-rate-limit
- In your config file (eg. config/autoload/global.php), add:
return [
// ...
'rate_limit' => [
'routes' => ['*'],
'storage' => [
'adapter' => Zend\Cache\Storage\Adapter\Filesystem::class,
'options' => [
'cache_dir' => __DIR__ . '/../../data/cache',
],
],
'limit' => 2,
'period' => 15,
]
];
RateLimit is licensed under The MIT License (MIT).