Provides a Token Bucket implementation to rate limit input and output in your Coole application. - 提供令牌桶实现来限制 Coole 应用程序中的输入和输出。
- PHP >= 7.2
$ composer require coolephp/rate-limiter --prefer-dist -vvv
- Copy
rate-limiter/config/rate-limiter.php
tocoole-skeleton/config/rate-limiter.php
. - Config
\Coole\RateLimiter\RateLimiter::class
middleware.
<?php
return [
/*
* App 名称
*/
'name' => env('APP_NAME', 'Coole'),
/*
* 全局中间件
*/
'middleware' => [
...
\Coole\RateLimiter\RateLimiter::class
...
],
];
$ composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.