PHPackages                             dantart/yii2-cronjobs - 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. dantart/yii2-cronjobs

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

dantart/yii2-cronjobs
=====================

cronjobs

1.1(5y ago)050BSD-3-ClausePHP

Since Dec 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dantart/yii2-cronjobs)[ Packagist](https://packagist.org/packages/dantart/yii2-cronjobs)[ RSS](/packages/dantart-yii2-cronjobs/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Yii2 cronjobs extension
=======================

[](#yii2-cronjobs-extension)

Easiest way to put crontab on your console scripts.

This extension is based on [this](https://github.com/Yiivgeny/Yii-PHPDocCrontab). Thanks [Yiivgeny](https://github.com/Yiivgeny).

But with a few changes:

- Work eith yii2
- Set config in params (not in phpDocs).

I transfer ​​settings of crontab in local settings(params) configuration, so that the application can be run on different servers with different sets of crontab.

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

[](#installation)

- **Step 1:** The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist dantart/yii2-cronjobs "dev-master"

```

or add

```
"dantart/yii2-cronjobs": "dev-master"

```

to the require section of your `composer.json` file.

- **Step 2:** Set aliase @runnerScript in console config. This absolutely path to runner script (I can not find another way to get runner script). Change path to runner script as your project (For Yii2 Basic application).

```
Yii::setAlias('@runnerScript', dirname(__DIR__) .'/yii');

```

- **Step 3:** Add to console config:

```
'controllerMap' => [
       'cron' => [
           'class' => 'dantart\cronjobs\CronController'
       ],
   ],

```

- **Step 4:** Add task to system scheduler (cron on unix, task scheduler on windows) to run every minute:

```
* * * * * /path/to/yii/application/protected/yiic cron
```

Usage
-----

[](#usage)

Add in params array with cron sets:

```
'cronJobs' =>[
        'test/example1' => [
            'cron'      => '* * * * *',
        ],
	'test/example2' => [
            'cron'      => '10 * * * *',
        ],

    ],

```

You can point any settings from [this](https://github.com/Yiivgeny/Yii-PHPDocCrontab/blob/master/examples/ExampleRuCommand.php).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

1983d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/647a0856cbc78cd2f38932ee3bb48f7791d16211f933f476a5e3cd3ef3acce7a?d=identicon)[dantart](/maintainers/dantart)

---

Top Contributors

[![adantart](https://avatars.githubusercontent.com/u/695272?v=4)](https://github.com/adantart "adantart (2 commits)")

---

Tags

yii2extensioncronjobs

### Embed Badge

![Health badge](/badges/dantart-yii2-cronjobs/health.svg)

```
[![Health](https://phpackages.com/badges/dantart-yii2-cronjobs/health.svg)](https://phpackages.com/packages/dantart-yii2-cronjobs)
```

###  Alternatives

[vyants/yii2-daemon

Extension provides functionality for simple daemons creation and control

7859.0k](/packages/vyants-yii2-daemon)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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