PHPackages                             dframe/cron - 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. dframe/cron

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

dframe/cron
===========

Cron component Dframe

v4.2.0(3y ago)23MITPHPPHP &gt;=7.3

Since Aug 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dframe/cron)[ Packagist](https://packagist.org/packages/dframe/cron)[ Docs](https://dframeframework.com/en/docs/dframe/master/cron/overview)[ RSS](/packages/dframe-cron/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (9)Used By (0)

Dframe/Cron - Component
=======================

[](#dframecron---component)

[![Build Status](https://camo.githubusercontent.com/d068272a7dff95771cc99c1bffad318cf4b9e33da3bc3b3c0e8b05a41ea46bf6/68747470733a2f2f7472617669732d63692e6f72672f646672616d652f63726f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dframe/cron) [![Latest Stable Version](https://camo.githubusercontent.com/e18b022f35bca8b68ac516011380136ed8306f078b1dbf6932dfdb0ab749d12d/68747470733a2f2f706f7365722e707567782e6f72672f646672616d652f63726f6e2f762f737461626c65)](https://packagist.org/packages/dframe/cron) [![Total Downloads](https://camo.githubusercontent.com/a1aa99e581bbfe98a25998753429ade2b457e66fac2da2c7a0ad0a8ab79798f6/68747470733a2f2f706f7365722e707567782e6f72672f646672616d652f63726f6e2f646f776e6c6f616473)](https://packagist.org/packages/dframe/cron) [![Latest Unstable Version](https://camo.githubusercontent.com/29ae1b95fca384d3700047bc40cc86dda4e539576d0e4a1b54f82ef378e9d49b/68747470733a2f2f706f7365722e707567782e6f72672f646672616d652f63726f6e2f762f756e737461626c65)](https://packagist.org/packages/dframe/cron) [![License](https://camo.githubusercontent.com/716009edef3b0c3a326ee4e6234d21172eed8dc8026fa407a09835088bc549cd/68747470733a2f2f706f7365722e707567782e6f72672f646672616d652f63726f6e2f6c6963656e7365)](https://packagist.org/packages/dframe/cron)

[![php framework dframe logo](https://camo.githubusercontent.com/fd0e41a4616aeae28318df2698482c0f1538928857ff531019f4481606ff8d2b/68747470733a2f2f646672616d656672616d65776f726b2e636f6d2f696d672f6c6f676f5f66756c6c2e706e67)](https://camo.githubusercontent.com/fd0e41a4616aeae28318df2698482c0f1538928857ff531019f4481606ff8d2b/68747470733a2f2f646672616d656672616d65776f726b2e636f6d2f696d672f6c6f676f5f66756c6c2e706e67)

### Documentation - [Cron PHP](https://dframeframework.com/en/docs/dframe/master/cron/overview)

[](#documentation---cron-php)

### Composer

[](#composer)

```
$ composer require dframe/cron
```

Cron
----

[](#cron)

Cron is a service to perform tasks periodically. It allows you to execute a command at a specified time. Sending emails is such an example.

```
use Dframe\Cron\Task;
use Dframe\Router\Response;

set_time_limit(0);
ini_set('max_execution_time', 0);
date_default_timezone_set('Europe/Warsaw');

require_once dirname(__DIR__) . '/../../../vendor/autoload.php';
require_once dirname(__DIR__) . '/../../../web/config.php';

/**
 * An anonymous Cron class that calls itself
 */
return (new class() extends Task
{

    /**
     * Init function
     *
     * @return array
     */
    public function init()
    {
        $cron = $this->inLock('mail', [$this->loadModel('Mail/Mail'), 'sendMails'], []);
        if ($cron['return'] == true) {
            $mail = $cron['response'];
            return Response::renderJSON(['code' => 200, 'message' => 'Cron Complete', 'data' => ['mail' => ['data' => $mail['response']]]]);
        }

        return Response::renderJSON(['code' => 403, 'message' => 'Cron in Lock'])->status(403);

    }

})->init()->display();
```

Methods
-------

[](#methods)

**lockTime(string $key, $ttl = 3600)**

Lock time

```
if ($this->lockTime('mail')) {
    return Response::renderJSON(['code' => 403, 'message' => 'Time Lock'])->status(403);
}
```

**inLock(string $key, object $loadModel, string $method, $args = \[\], $ttl = 3600)**

This method has a built-in method that blocks it until complete.

```
$this->inLock('mail', [$this->loadModel('Mail/Mail'), 'sendMails'], []);
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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 ~113 days

Recently: every ~68 days

Total

8

Last Release

1344d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9001348?v=4)[Sławomir Kaleta](/maintainers/dusta)[@dusta](https://github.com/dusta)

---

Top Contributors

[![dusta](https://avatars.githubusercontent.com/u/9001348?v=4)](https://github.com/dusta "dusta (30 commits)")

---

Tags

php crondframe

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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