net_bazzline/php_component_time_limit_manager 问题修复 & 功能扩展

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

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

net_bazzline/php_component_time_limit_manager

Composer 安装命令:

composer require net_bazzline/php_component_time_limit_manager

包简介

free as in freedom php component to validate if your script is reaching the allowed maximum runtime

README 文档

README

This component helps you to validate if your script reaches the allowed maximum runtime.

Furthermore, you can set your own runtime limit (as long as it is below the limit in you php.ini).

The build status of the current master branch is tracked by Travis CI: build status Latest stable

The scrutinizer status are: code quality

The versioneye status is: dependencies

Downloads: Downloads this Month

It is also available at openhub.net.

Benefits

  • provides easy setting of runtime limit
  • gives you the advantage to add a buffer before reaching the limit to easy up reacting when limit is reached
  • helps you to set the limit in seconds, minutes or hours (same for the buffer)
  • comes with DependentInterface and AwareInterface

Examples

Install

By Hand

mkdir -p vendor/net_bazzline/php_component_time_limit_manager
cd vendor/net_bazzline/php_component_time_limit_manager
git clone https://github.com/bazzline/php_component_time_limit_manager

With Packagist

composer require net_bazzline/php_component_time_limit_manager:dev-master

Usage

$manager = new Net\Bazzline\Component\TimeLimitManager\TimeLimitManager();
$manager->setBufferInSeconds(1);
$manager->setLimitInSeconds(4);

while (!empty($dataSet)) {
    if ($manager->isLimitReached()) {
        //exit while loop, shutdown process
    } else {
        $data = array_shift($dataSet);
        //work on data set
    }
}

API

API is available at bazzline.net

History

  • upcomming
    • @todo
      • implement way of measure/calculate the amount of time for next iteration
  • 1.0.11 - released at 10.08.2016
    • updated phpunit (developer dependency)
  • 1.0.10 - released at 30.05.2016
    • added dedicated travis integration test for php 7.0
    • relaxed mockery dependency
    • removed dedicated travis integration test for php 5.3.3
  • 1.0.9 - released at 07.02.2016
    • moved to psr-7 autoloading
    • updated dependencies
  • 1.0.8 - released at 11.01.2016
    • fixed dependency handling for phpunit 4.8.*
  • 1.0.7 - released at 11.12.2015
    • updated dependencies
  • 1.0.6 - released at 18.11.2015
    • updated dependencies
  • 1.0.5 - released at 28.08.2015
    • updated dependencies
  • 1.0.4 - released at 04.07.2015
    • removed local apigen documentation
    • removed useless code coverage image
    • updated dependencies
  • 1.0.3 - released at 22.05.2015
    • updated dependencies
  • 1.0.2 - released at 08.02.2015
    • updated dependencies
    • removed dependency to apigen
  • 1.0.1 - released at 31.08.2014
    • add getRuntimeIn[Seconds|Minutes|Hours]
    • extended unit tests by covering setting of the buffer
    • added getter for minutes and hours
    • updated dependencies
  • 1.0.0 - released at 27.07.2014
    • added examples, unit tests and api
  • 0.0.1 - released at 27.07.2014
    • initial commit with stable api

Future Improvements

  • if you have one, create a feature request, fork it (and push it back :-))

Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-].

统计信息

  • 总下载量: 1.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPLv3
  • 更新时间: 2014-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固