imj/frequency
Composer 安装命令:
composer require imj/frequency
包简介
A simple frequency control system based on redis
关键字:
README 文档
README
Installation
composer require imj/frequency
Basic Usage
use Imj\Frequency; $config = [ 'time_unit' => 5, 'recycle' => 120, 'default' => 0, 'rules' => [ 10 => [ 10 => 1, // 10分钟操作10次及以上返回1 20 => 2, 30 => 3, 40 => 4, ], 20 => [ 80 => 5 ] ] ]; $redis = getRedis(); $freq = new Frequency($redis, $config); $ip = getIp(); $ret= $freq->check($ip); $min = 10; $times = $freq->checkTimes($ip, $min);
License
licensed under the MIT License - see the LICENSE file for details
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-20