Habari\Update::cron PHP Method

cron() public static method

Loads beacons, checks for updates from hp.o, and saves any updates to the DB.
public static cron ( null $cronjob = null ) : boolean
$cronjob null Unused. The CronJob object being executed when being run as cron.
return boolean True on successful check, false on any failure (so cron runs again).
    public static function cron($cronjob = null)
    {
        // register the beacons
        self::register_beacons();
        // save the list of beacons we are using to check with
        Options::set('updates_beacons', self::instance()->beacons);
        try {
            // run the check
            $updates = Update::check();
            // save the list of updates
            Options::set('updates_available', $updates);
            EventLog::log(_t('Updates check CronJob completed successfully.'), 'info', 'update', 'habari');
            // return true, we succeeded
            return true;
        } catch (\Exception $e) {
            // catch any exceptions generated by RemoteRequest or XML parsing
            EventLog::log(_t('Updates check CronJob failed!'), 'err', 'update', 'habari', $e->getMessage());
            // tell cron the check failed
            return false;
        }
    }