承接 bitsbeats/softfailer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bitsbeats/softfailer

Composer 安装命令:

composer require bitsbeats/softfailer

包简介

Library to suppress errors unless they exceed a certain threshold within a given time interval

README 文档

README

PHP library to suppress errors ("soft failures") unless they exceed a certain threshold within a given time interval.

Features

  • uses persistent storage, so that failures are counted among independent script calls or pageviews
  • storage drivers for filesystem, memcache and APCu

Install

The easiest way to install SoftFailer is by using composer:

$> composer require bitsbeats/softfailer

Usage

$storage = new Filesystem('/tmp/softfail.txt', 500);

// hard fail if 3 or more "soft fails" occur within a 3600 second time window
$sf = new SoftFailer($storage, 3, 3600);

try {
    $sf->recordFailure(new DateTime());
}
catch (HardFailLimitReachedException $e) {
    // a "hard fail" is triggered by throwing a "HardFailLimitReachedException" exception
    print "FAIL: {$e->getMessage()}\n";
    $sf->clearFailPoints();
    exit(1);
}

See example.php for the full example.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-08-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固