4 include_once
"Services/Cron/classes/class.ilCronJob.php";
18 return "webr_link_check";
27 return $lng->txt(
"check_web_resources");
36 return $lng->txt(
"check_web_resources_desc");
41 return self::SCHEDULE_TYPE_DAILY;
63 $ilLog = $DIC->logger()->webr();
69 include_once
'./Services/LinkChecker/classes/class.ilLinkChecker.php';
77 $tmp_webr->initLinkResourceItemsObject();
82 $link_checker->setMailStatus(
true);
84 $link_checker->setObjId($tmp_webr->getId());
88 foreach ($link_checker->checkWebResourceLinks() as $invalid) {
89 $tmp_webr->items_obj->readItem($invalid[
'page_id']);
90 $tmp_webr->items_obj->setActiveStatus(
false);
91 $tmp_webr->items_obj->setValidStatus(
false);
92 $tmp_webr->items_obj->setDisableCheckStatus(
true);
93 $tmp_webr->items_obj->setLastCheckDate(time());
94 $tmp_webr->items_obj->update(
false);
99 foreach ($link_checker->getLogMessages() as
$message) {
116 case self::SCHEDULE_TYPE_DAILY:
117 $period = 24 * 60 * 60;
120 case self::SCHEDULE_TYPE_WEEKLY:
121 $period = 7 * 24 * 60 * 60;
124 case self::SCHEDULE_TYPE_MONTHLY:
125 $period = 30 * 7 * 24 * 60 * 60;
128 case self::SCHEDULE_TYPE_QUARTERLY:
129 $period = 3 * 30 * 7 * 24 * 60 * 60;
145 $ilSetting->set(
"cron_web_resource_check", (
bool) $a_currently_active);
activationWasToggled($a_currently_active)
Cron job application base class.
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
catch(Exception $e) $message
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
getDefaultScheduleValue()
Cron job result data container.
getScheduleType()
Get current schedule type (if flexible)