ziya / yii-cron
Yii cron package
Installs: 2 647
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2025-04-17 17:03:29 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
composer require ziya/yii-cron
or add
"ziya/yii-cron": "*"
to the require section of your composer.json
file.
Configuration
Before using you must migrate
php yii migrate --migrationPath="@vendor/ziya/yii-cron/src/migrations
Usage
Send sms cron
<?php class SendSmsCron extends \Ziya\YiiCron\BaseCron { public static function key(){ return 'send_sms_cron' } public function execute(){ $sms = new Sms(); $sms->phone_number = 123456789; $sms->body = "Hello world !"; $sms->send(); } } ?>
Running crons
<?php $list = [ SendSmsCron::class ]; $cron = new \Ziya\YiiCron\CronList($list); $cron->execute(); ?>