public function is_cron_required() {
        global $CFG;

        $name = $this->get_name();
        $versionfile = "$CFG->dirroot/enrol/$name/version.php";
        $plugin = new stdClass();
        include($versionfile);
        if (empty($plugin->cron)) {
            return false;
        }
        $lastexecuted = $this->get_config('lastcron', 0);
        if ($lastexecuted + $plugin->cron < time()) {
            return true;
        } else {
            return false;
        }
    }
public function is_cron_required() {
        global $CFG;

        $name = $this->get_name();
        $versionfile = "$CFG->dirroot/enrol/$name/version.php";
        $plugin = new stdClass();
        include($versionfile);
        if (empty($plugin->cron)) {
            return false;
        }
        $lastexecuted = $this->get_config('lastcron', 0);
        if ($lastexecuted + $plugin->cron < time()) {
            return true;
        } else {
            return false;
        }
    }
public function is_cron_required ( ) { global $ CFG ; $ name = $ this -> get_name ( ) ; $ versionfile = "$CFG->dirroot/enrol/$name/version.php" ; $ plugin = new stdClass ( ) ; include ( $ versionfile ) ; if ( empty ( $ plugin -> cron ) ) { return false ; } $ lastexecuted = $ this -> get_config ( 'lastcron' , 0 ) ; if ( $ lastexecuted + $ plugin -> cron < time ( ) ) { return true ; } else { return false ; } }
Reads version.php and determines if it is necessary
to execute the cron job now.
@return bool
Reads version . php and determines if it is necessary to execute the cron job now .