4 include_once
"Services/Cron/classes/class.ilCronJob.php";
18 return "webr_link_check";
25 return $lng->txt(
"check_web_resources");
32 return $lng->txt(
"check_web_resources_desc");
37 return self::SCHEDULE_TYPE_DAILY;
61 include_once
'./Services/LinkChecker/classes/class.ilLinkChecker.php';
69 $tmp_webr->initLinkResourceItemsObject();
74 $link_checker->setMailStatus(
true);
76 $link_checker->setObjId($tmp_webr->getId());
80 foreach ($link_checker->checkWebResourceLinks() as $invalid) {
81 $tmp_webr->items_obj->readItem($invalid[
'page_id']);
82 $tmp_webr->items_obj->setActiveStatus(
false);
83 $tmp_webr->items_obj->setValidStatus(
false);
84 $tmp_webr->items_obj->setDisableCheckStatus(
true);
85 $tmp_webr->items_obj->setLastCheckDate(
time());
86 $tmp_webr->items_obj->update(
false);
91 foreach ($link_checker->getLogMessages() as
$message) {
108 case self::SCHEDULE_TYPE_DAILY:
109 $period = 24 * 60 * 60;
112 case self::SCHEDULE_TYPE_WEEKLY:
113 $period = 7 * 24 * 60 * 60;
116 case self::SCHEDULE_TYPE_MONTHLY:
117 $period = 30 * 7 * 24 * 60 * 60;
120 case self::SCHEDULE_TYPE_QUARTERLY:
121 $period = 3 * 30 * 7 * 24 * 60 * 60;
135 $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()
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Cron job result data container.
getScheduleType()
Get current schedule type (if flexible)