PHP code example of dynamikaweb / yii2-fake-cronjob

1. Go to this page and download the library: Download dynamikaweb/yii2-fake-cronjob library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dynamikaweb / yii2-fake-cronjob example snippets


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

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