coolephp / rate-limiter
Provides a Token Bucket implementation to rate limit input and output in your Coole application. - 提供令牌桶实现来限制 Coole 应用程序中的输入和输出。
Fund package maintenance!
Wechat
Requires
- php: >=7.2
- guanguans/coole: ^1.0
- symfony/cache: ^5.0
- symfony/rate-limiter: ^5.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.7
- friendsofphp/php-cs-fixer: ^2.16
- mockery/mockery: ^1.2
- overtrue/phplint: ^2.3
- phpunit/phpunit: ^7 || ^8
- vimeo/psalm: ^3.11
README
Provides a Token Bucket implementation to rate limit input and output in your Coole application. - 提供令牌桶实现来限制 Coole 应用程序中的输入和输出。
Requirement
- PHP >= 7.2
Installation
$ composer require coolephp/rate-limiter --prefer-dist -vvv
Usage
- 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 ... ], ];
Testing
$ composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.