dynamikaweb/yii2-fake-cronjob

Installs: 222

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:yii2-extension

1.0 2021-05-04 14:01 UTC

This package is auto-updated.

Last update: 2024-12-10 20:10:34 UTC


README

Latest Stable Version Total Downloads License Codacy Badge Build Test

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require dynamikaweb/yii2-fake-cronjob "*"
$ composer require omnilight/yii2-scheduling "*"

or add

"dynamikaweb/yii2-fake-cronjob": "*",
"omnilight/yii2-scheduling": "*"

to the require section of your composer.json file.

And append

[
    'components' => [
        // this plugin
        'cronjob' => [
            'class' => 'dynamikaweb\fakecronjob\FakeCronJob'
        ],
        // suggested
        'schedule' => [
            'class' => 'omnilight\scheduling\Schedule'
        ],
        ...
    ]
]

to install application component of your config/main.php file.

Usage

Yii::$app->schedule->command('foo')->daily()->description('mycommand');
Yii::$app->cronjob->update('mycommand');

see more schedule examples in https://github.com/omnilight/yii2-scheduling