PHP code example of lekoala / silverstripe-simple-jobs

1. Go to this page and download the library: Download lekoala/silverstripe-simple-jobs 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/ */

    

lekoala / silverstripe-simple-jobs example snippets


class TestCron implements CronTask {

    /**
    * run this task every every day
    *
    * @return string
    */
    public function getSchedule() {
        return SimpleJobsSchedules::EVERY_DAY;
    }

    /**
    *
    * @return void
    */
    public function process() {
        echo 'hello';
    }
}

$task = new SimpleTask();

$task->addToTask($this, "removeStuff", [
    $some_stuff_id,
]);
yml
LeKoala\SimpleJobs\SimpleJobsDailyTask:
    clean_sessions: false