PHPackages                             djiney/yii2-crontab - 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. [Framework](/categories/framework)
4. /
5. djiney/yii2-crontab

ActiveYii2-extension[Framework](/categories/framework)

djiney/yii2-crontab
===================

Yii Framework 2.0 Component crontab manager

075PHP

Since Nov 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/djiney/yii2-crontab)[ Packagist](https://packagist.org/packages/djiney/yii2-crontab)[ RSS](/packages/djiney-yii2-crontab/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2-crontab
============

[](#yii2-crontab)

Extension for Yii2, which is helpful, when you don't want to edit your server cron configuration every time you add or delete a new cron task. Also can help with task distribution on multi-server systems.

Installing
----------

[](#installing)

Composer installation

```
composer require djiney/yii2-crontab dev-master

```

Configuration
-------------

[](#configuration)

You can find more specific information in code

### Migration

[](#migration)

Just run base Yii2 migration with custom path

```
php yii migrate/up --migrationPath=@vendor/djiney/yii2-crontab/src/migrations/

```

### Controller

[](#controller)

Add controller class for your console application config:

```
'controllerMap' => [
   ...
   'task-manager' => 'djiney\crontab\controllers\TaskManagerController'
   ...
],

```

### Component

[](#component)

Specify configuration component with tasks:

```
'components' => [
   ...
   'cron' => [
      'class' => 'djiney\crontab\components\Configuration',
      'tasks' => require(__DIR__ . '/cron.php')
   ],
   ...
],

```

Each task has it's own configuration template:

```
'cron/balance' => [
   'command' => '/var/www/html/yii cron/balance',
   'log' => '/var/www/html/balance.log',
   'interval' => [
      'minute'   => '*/8',
      'hour'     => '11',
      'day'      => '12-14',
      'month'    => '1,3',
      'week_day' => '5'
    ],
],

```

### Server cron

[](#server-cron)

Don't forget to add cron-task to your server (you can add this command to all of your servers, tasks won't be duplicated).

```
* * * * * sudo -u nginx /var/www/html/yii task-manager/create-tasks >> /var/www/html/console/runtime/logs/create-tasks.log
* * * * * sudo -u nginx /var/www/html/yii task-manager/start-tasks >> /var/www/html/console/runtime/logs/start-tasks.log

```

!! Space in the end of cron file is important !!

On Centos 7 path to this file is usually

```
/var/spool/cron/root

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8615edc16943839a65e1778bcc1a7eea33b980af35dc4126af01aae025281d6d?d=identicon)[MikhailGorchakov](/maintainers/MikhailGorchakov)

---

Top Contributors

[![djiney](https://avatars.githubusercontent.com/u/14149388?v=4)](https://github.com/djiney "djiney (1 commits)")

### Embed Badge

![Health badge](/badges/djiney-yii2-crontab/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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