ozziest/overdose 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ozziest/overdose

最新稳定版本:1.0.0

Composer 安装命令:

composer require ozziest/overdose

包简介

Overdose is a guardian which is protects your sistem from request flood.

README 文档

README

Overdose is a guardian which is protects your system from request floods.

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "ozziest/overdose": "1.*"
    }
}
$ composer install

Usage

This library depended to desarrolla2/cache. You must create cache object and sending to Overdose for usage.

// Creating new cache object
use Desarrolla2\Cache\Cache;
use Desarrolla2\Cache\Adapter\File;

$cacheDir = '/tmp';
$adapter = new File($cacheDir);
$adapter->setOption('ttl', 3600);
$cache = new Cache($adapter);

// Creating overdose
$overdose = new Ozziest\Overdose\Overdose($cache);
try {
    $overdose->isSecure();
} catch (Ozziest\Overdose\OverdoseException $e) {
    exit($e->getMessage());
}

Configuration

You can change runtime options for security.

$overdose = new Ozziest\Overdose\Overdose($cache);
$overdose->set([
                'acceptable' => 5,
                'safe'       => 10,
                'max'        => 3,
                'recreation' => 60
            ]) 
         ->isSecure();
  • acceptable: Acceptable sec for every request interval. If request interval smaller than acceptable, that request is a overdose.
  • safe: Safety sec. for every request interval. If request interval greater than safe, overdose count will reduce.
  • max: Maximum overdose count for recreation time activation.
  • recreation: Recreation time. (sec)

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-30