ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLearningModuleCronLinkCheck.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
15{
19 protected $lng;
20
24 protected $log;
25
29 protected $db;
30
31
35 public function __construct()
36 {
37 global $DIC;
38
39 $this->lng = $DIC->language();
40 $this->log = $DIC["ilLog"];
41 $this->db = $DIC->database();
42 }
43
44 public function getId()
45 {
46 return "lm_link_check";
47 }
48
49 public function getTitle()
50 {
52
53 return $lng->txt("check_link");
54 }
55
56 public function getDescription()
57 {
59
60 return $lng->txt("check_link_desc");
61 }
62
63 public function getDefaultScheduleType()
64 {
66 }
67
68 public function getDefaultScheduleValue()
69 {
70 return;
71 }
72
73 public function hasAutoActivation()
74 {
75 return false;
76 }
77
78 public function hasFlexibleSchedule()
79 {
80 return false;
81 }
82
83 public function run()
84 {
85 $ilLog = $this->log;
87
89
90 $link_checker = new ilLinkChecker($ilDB);
91 $link_checker->setMailStatus(true);
92
93 $link_checker->checkLinks();
94
95 $counter = 0;
96 foreach ($link_checker->getLogMessages() as $message) {
97 $ilLog->write($message);
98 $counter++;
99 }
100
101 if ($counter) {
103 }
104 $result = new ilCronJobResult();
105 $result->setStatus($status);
106 return $result;
107 }
108}
$result
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_DAILY
hasFlexibleSchedule()
Can the schedule be configured?
hasAutoActivation()
Is to be activated on "installation".
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
global $DIC
Definition: goto.php:24
global $ilDB
$message
Definition: xapiexit.php:14