/zf-rate-limit

A Zend Framework module that helps you to deal with rate limit.

Primary LanguagePHPMIT LicenseMIT

RateLimit

A Zend Framework module that helps you to deal with rate limit.

HOW TO USE

  1. In your composer.json file, add:
    "repositories": [
        {
            "url": "https://github.com/inmediam/zf-rate-limit.git",
            "type": "git"
        }
    ],
  1. In the terminal, run:
composer require inmediam/zf-rate-limit
  1. 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,
    ]
];

License

RateLimit is licensed under The MIT License (MIT).