Giter Club home page Giter Club logo

php_component_time_limit_manager's Introduction

Time Limit Manager Component for PHP

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
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 :-].

php_component_time_limit_manager's People

Contributors

stevleibelt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

php_component_time_limit_manager's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.