PHP code example of understeam / yii2-command-scheduler

1. Go to this page and download the library: Download understeam/yii2-command-scheduler 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/ */

    

understeam / yii2-command-scheduler example snippets


Yii::$app->scheduler->add(
    'my-unique-command-key',    // Unique task key. If task already exists it will be replaced
    $command,                   // Command. May be literally anything. See Executor section
    '0 0 * * *',                // Cron expression
    false                       // Repeat after success execution? Default - true
);