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

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

sharkom/yii2-cron
=================

Create Cron jobs from browser, and look that run logs

v2.0.1(1y ago)56.0k↓46.6%2MITPHP

Since Apr 29Pushed 7mo agoCompare

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

READMEChangelog (5)Dependencies (5)Versions (23)Used By (0)

Yii2 Cron job Manager
=====================

[](#yii2-cron-job-manager)

Create Cron jobs from browser, and look that run logs

Forked from vasadibt/yii2-cron with some modifications:

1. Now it can run every kind of script, not only Yii2 console commands
2. Added capability to have a log file in addition to DB logs
3. Removed the runquick capabilities

ChangeLog 27/Feb/2023

1. Add Manual Run button on cronjob page
2. Add auto purge logs (use module param purge\_log\_interval | default 3 months)
3. Fix some graphics in logs pages

ChangeLog 5/May/2023

1. Added execution error mail notifications
2. Added auto unlock mail notifications
3. Added module param sendNotifications

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist sharkom/yii2-cron "*"

```

or add

```
"sharkom/yii2-cron": "*"

```

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

### Migration

[](#migration)

Run the following command in Terminal for database migration:

```
yii migrate/up --migrationPath=@sharkom/cron/migrations

```

Or use the [namespaced migration](http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#namespaced-migrations) (requires at least Yii 2.0.10):

```
// Add namespace to console config:
'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationPath' => [
            '@sharkom/cron/migrations',
        ],
    ],
],
```

Then run:

```
yii migrate/up

```

### Web Application Config

[](#web-application-config)

Turning on the Cron Job Manager Module in the web application:

Simple example:

```
'modules' => [
    'cron' => [
        'class' => 'sharkom\cron\Module',
        'params'=>[
            'sendNotifications'=>true,
        ]
    ],
],
```

### Console Application Config

[](#console-application-config)

Turning on the Cron Job Manager Module in the console application:

Simple example:

```
'modules' => [
    'cron' => [
        'class' => 'sharkom\cron\Module',
        'params'=>[
            'sendNotifications'=>true,
        ]
    ],
],
```

### Schedule Config

[](#schedule-config)

Set the server schedule to run the following command

On Linux:

Add to the crontab with the user who you want to run the script (possibly not root) with the `crontab -e` command or by editing the `/etc/crontab` file

```
* * * * * /yii cron/cron/run 2>&1
```

On Windows:

Open the task scheduler and create a new task

\###Email notifications

In order to recieve email notifications for execution errors you need to config:

1. The module param sendNotifications to true (check Web App and Console App configuration in this readme)
2. Set in common/config/params.php the parameters:
    1. senderEmail
    2. NotificationsEmail
3. Configure the mailer in common/config/main-local.php

```
return [
    'senderEmail'=>'notifications@yourapp.net',
    'NotificationsEmail'=>'notifications@yourapp.net',
];
```

```
'mailer' => [
   'class' => 'yii\swiftmailer\Mailer',
   // send all mails to a file by default. You have to set
   // 'useFileTransport' to false and configure a transport
   // for the mailer to send real emails.
   'useFileTransport' => false,
   'transport' => [
      'class' => 'Swift_SmtpTransport',
      'encryption' => 'tls',
      'host' => 'your smtp relay',
      'port' => '25',
      'username' => 'your user',
      'password' => 'your password',
   ],
],
```

.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance55

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~117 days

Total

22

Last Release

482d ago

Major Versions

v1.1.11 → v2.0.02024-11-12

v2.0.1 → v3.x-dev2025-01-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/b031b6ed949d8e15ed54ea1142d9af605f166bed419c25e5aa558fc682629f25?d=identicon)[SharKom](/maintainers/SharKom)

---

Top Contributors

[![AndreaGvA](https://avatars.githubusercontent.com/u/1787039?v=4)](https://github.com/AndreaGvA "AndreaGvA (23 commits)")[![fullmvc](https://avatars.githubusercontent.com/u/45456263?v=4)](https://github.com/fullmvc "fullmvc (12 commits)")[![vasadibt](https://avatars.githubusercontent.com/u/9213794?v=4)](https://github.com/vasadibt "vasadibt (9 commits)")[![SharKom](https://avatars.githubusercontent.com/u/34657941?v=4)](https://github.com/SharKom "SharKom (6 commits)")[![honsa](https://avatars.githubusercontent.com/u/526006?v=4)](https://github.com/honsa "honsa (1 commits)")

---

Tags

cronscheduleyii2extensionmodule

### Embed Badge

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

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

###  Alternatives

[onmotion/yii2-telegram

Support chat for site based on Telegram bot

526.3k](/packages/onmotion-yii2-telegram)[kriss/yii2-calendar-schedule

Yii2 Calendar Schedule

107.9k](/packages/kriss-yii2-calendar-schedule)

PHPackages © 2026

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