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;
}
}