PHPackages                             net\_bazzline/php\_component\_time\_limit\_manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. net\_bazzline/php\_component\_time\_limit\_manager

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

net\_bazzline/php\_component\_time\_limit\_manager
==================================================

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

1.0.11(9y ago)31.9k[1 issues](https://github.com/bazzline/php_component_time_limit_manager/issues)1LGPLv3PHPPHP &gt;=5.3.3

Since Jul 27Pushed 9y ago5 watchersCompare

[ Source](https://github.com/bazzline/php_component_time_limit_manager)[ Packagist](https://packagist.org/packages/net_bazzline/php_component_time_limit_manager)[ RSS](/packages/net-bazzline-php-component-time-limit-manager/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (13)Used By (1)

Time Limit Manager Component for PHP
====================================

[](#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](https://camo.githubusercontent.com/a7f4c5b8024b6283b21f223f1347f1f4375f796944ab55335da214002fdec0b4/68747470733a2f2f7472617669732d63692e6f72672f62617a7a6c696e652f7068705f636f6d706f6e656e745f74696d655f6c696d69745f6d616e616765722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/bazzline/php_component_time_limit_manager)[![Latest stable](https://camo.githubusercontent.com/4eba8d2316d60a97ecc25060b3cd8c2d0bae4a47ae75e738393167dcdb4c7325/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65745f62617a7a6c696e652f7068705f636f6d706f6e656e745f74696d655f6c696d69745f6d616e616765722e737667)](https://packagist.org/packages/net_bazzline/php_component_time_limit_manager)

The scrutinizer status are: [![code quality](https://camo.githubusercontent.com/c3c073505596fe6a16077276c179c71f4af5ffd144f80e6050e1f8e44b407f36/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617a7a6c696e652f7068705f636f6d706f6e656e745f74696d655f6c696d69745f6d616e616765722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bazzline/php_component_time_limit_manager/)

The versioneye status is: [![dependencies](https://camo.githubusercontent.com/c30fbf3c14e06ecef73f47a13f9fd35b3649e2bd491e5f6b3503d6e8f124fceb/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3533653465633938653061323239626365633030303131632f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/53e4ec98e0a229bcec00011c)

Downloads: [![Downloads this Month](https://camo.githubusercontent.com/d8f4a6ca188a6b32b1fd973c201b77f7fd567daf2e4940f9697e9098c4857b78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65745f62617a7a6c696e652f7068705f636f6d706f6e656e745f74696d655f6c696d69745f6d616e616765722e737667)](https://packagist.org/packages/net_bazzline/php_component_time_limit_manager)

It is also available at [openhub.net](http://www.openhub.net/p/718008).

Benefits
========

[](#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](https://github.com/bazzline/php_component_time_limit_manager/blob/master/source/TimeLimitManagerDependentInterface.php) and [AwareInterface](https://github.com/bazzline/php_component_time_limit_manager/blob/master/source/TimeLimitManagerAwareInterface.php)

Examples
========

[](#examples)

- [with reaching runtime limit](https://github.com/bazzline/php_component_time_limit_manager/blob/master/example/Example/withReachingLimit.php)
- [without reaching runtime limit](https://github.com/bazzline/php_component_time_limit_manager/blob/master/example/Example/withoutReachingLimit.php)

Install
=======

[](#install)

By Hand
-------

[](#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](https://packagist.org/packages/net_bazzline/php_component_time_limit_manager)
----------------------------------------------------------------------------------------------

[](#with-packagist)

```
composer require net_bazzline/php_component_time_limit_manager:dev-master

```

Usage
=====

[](#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)

[API](http://bazzline.net/70a2476a6a32b01511ef76c2360fa44bdcf14403/index.html) is available at [bazzline.net](http://www.bazzline.net)

History
=======

[](#history)

- upcomming
    - @todo
        - implement way of measure/calculate the amount of time for next iteration
- [1.0.11](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.11) - released at 10.08.2016
    - updated phpunit (developer dependency)
- [1.0.10](https://github.com/bazzline/php_component_time_limit_manager/tree/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](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.9) - released at 07.02.2016
    - moved to psr-7 autoloading
    - updated dependencies
- [1.0.8](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.8) - released at 11.01.2016
    - fixed dependency handling for phpunit 4.8.\*
- [1.0.7](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.7) - released at 11.12.2015
    - updated dependencies
- [1.0.6](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.6) - released at 18.11.2015
    - updated dependencies
- [1.0.5](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.5) - released at 28.08.2015
    - updated dependencies
- [1.0.4](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.4) - released at 04.07.2015
    - removed local apigen documentation
    - removed useless code coverage image
    - updated dependencies
- [1.0.3](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.3) - released at 22.05.2015
    - updated dependencies
- [1.0.2](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.2) - released at 08.02.2015
    - updated dependencies
    - removed dependency to apigen
- [1.0.1](https://github.com/bazzline/php_component_time_limit_manager/tree/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](https://github.com/bazzline/php_component_time_limit_manager/tree/1.0.0) - released at 27.07.2014
    - added examples, unit tests and api
- [0.0.1](https://github.com/bazzline/php_component_time_limit_manager/tree/0.0.1) - released at 27.07.2014
    - initial commit with stable api

Future Improvements
===================

[](#future-improvements)

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

Final Words
===========

[](#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](https://gratipay.com/~stevleibelt) if you love it :-\].

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~87 days

Total

11

Last Release

3560d ago

Major Versions

0.0.1 → 1.0.02014-07-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/58451b041f6f5a38c7e62762c96d01f5e2bcac30e322707fe4760a82bccb6856?d=identicon)[artodeto](/maintainers/artodeto)

---

Top Contributors

[![stevleibelt](https://avatars.githubusercontent.com/u/2287220?v=4)](https://github.com/stevleibelt "stevleibelt (85 commits)")

---

Tags

psrphpruntimecomponentbazzlinelgplfree as in freedomlimitPSR-4runtime limitmaximum runtimetime limit managerruntime managerruntime limit manager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/net-bazzline-php-component-time-limit-manager/health.svg)

```
[![Health](https://phpackages.com/badges/net-bazzline-php-component-time-limit-manager/health.svg)](https://phpackages.com/packages/net-bazzline-php-component-time-limit-manager)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
