PHPackages                             steinm6/cron-helper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. steinm6/cron-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

steinm6/cron-helper
===================

Simple helper to prevent parallel cronjob execution

1.1.0(11y ago)397BSD-3-ClausePHP

Since Oct 18Pushed 11y ago1 watchersCompare

[ Source](https://github.com/steinm6/cron-helper)[ Packagist](https://packagist.org/packages/steinm6/cron-helper)[ RSS](/packages/steinm6-cron-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

cron-helper
===========

[](#cron-helper)

Simple helper to prevent parallel cronjob execution

Installation
------------

[](#installation)

### Composer

[](#composer)

Require `"steinm6/cron-helper": "dev-master"`

### Manually

[](#manually)

Just include the file `src/CronHelper.php`

Usage
-----

[](#usage)

Initialize the CronHelper with a filename. The CronHelper will use this filename for locking up.

`$cron = new CronHelper('myfilename');`

To lock the execution call the lock()-function. To unlock the cronjob use the unlock()-function. You may determine how long the cronjob was locked by calling the getLockDuration()-function, which returns the time passed since the lock() in seconds.

Here is a basic example on how to use the CronHelper:

```
use steinm6\CronHelper\CronHelper;

// Initialize CronHelper
$cron = new CronHelper('lockfile-name');

// lock this job
if ($cron->lock()) {
	foreach($x as $y){
		// You might want to reset the timer, to prevent running into the unlock() below...
		$cron->resetTimer();

		// Do something
		sleep(10);
	}
	$cron->unlock();
} else {
  // If the lock persists for 3600 seconds, something went wrong. Remove the lock so that the next cronjob is executed.
	if ($cron->getLockDuration() > 3600)
		$cron->unlock();
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~2 days

Total

2

Last Release

4220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36d326664e367de56b4923496f09532d3a55170073ce53d1f7ef805ea510263b?d=identicon)[steinm](/maintainers/steinm)

---

Top Contributors

[![disup](https://avatars.githubusercontent.com/u/7162150?v=4)](https://github.com/disup "disup (5 commits)")[![steinm6](https://avatars.githubusercontent.com/u/8216787?v=4)](https://github.com/steinm6 "steinm6 (5 commits)")

### Embed Badge

![Health badge](/badges/steinm6-cron-helper/health.svg)

```
[![Health](https://phpackages.com/badges/steinm6-cron-helper/health.svg)](https://phpackages.com/packages/steinm6-cron-helper)
```

###  Alternatives

[smart-crowd/simple-sms-drivers

Addition providers for simple SMS laravel package

101.0k](/packages/smart-crowd-simple-sms-drivers)

PHPackages © 2026

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