52 $ilSetting->set(
'last_cronjob_start_ts', time());
54 if( $_SERVER[
'argc'] > 4 )
for($i = 4; $i < $_SERVER[
'argc']; $i++)
56 $arg = $_SERVER[
'argv'][$i];
58 if( !isset($this->possible_tasks[
$arg]) )
59 throw new ilException(
'cron-task "'.$arg.
'" is not defined');
61 $task = $this->possible_tasks[
$arg];
65 else foreach($this->default_tasks as $task)
67 $task = $this->possible_tasks[$task];
79 $classlocation = $task[
'location'].
'/classes';
80 if( isset($task[
'sub_location']) && strlen($task[
'sub_location']) )
82 $classlocation .=
'/'.$task[
'sub_location'];
84 $classfile .= $classlocation.
'/class.'.$task[
'classname'].
'.php';
86 $classname = $task[
'classname'];
87 $method = $task[
'method'];
89 $condition = $task[
'condition'];
95 if( !file_exists($classfile) )
96 throw new ilException(
'class file "'.$classfile.
'" does not exist');
98 require_once($classfile);
100 if( !class_exists($classname) )
101 throw new ilException(
'class "'.$classname.
'" does not exist');
103 if( !method_exists($classname, $method) )
104 throw new ilException(
'method "'.$classname.
'::'.$method.
'()" does not exist');
112 $task =
new $classname;
121 require_once(
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php');
123 $this->default_tasks = array(
124 'ilLDAPCronSynchronization::start',
125 'ilCronCheckUserAccounts::check',
126 'ilLuceneIndexer::index',
127 'ilCronLinkCheck::check',
128 'ilCronWebResourceCheck::check',
129 'ilCronForumNotification::sendNotifications',
130 'ilCronMailNotification::sendNotifications',
131 'ilCronValidator::check',
132 'ilCronDiskQuotaCheck::updateDiskUsageStatistics',
133 'ilCronDiskQuotaCheck::sendReminderMails',
135 #
'ilPaymentShoppingCart::__deleteExpiredSessionsPSC',
136 'ilCronDeleteInactiveUserAccounts::run'
139 $this->possible_tasks = array(
141 'ilLDAPCronSynchronization::start' => array(
142 'classname' =>
'ilLDAPCronSynchronization',
144 'location' =>
'Services/LDAP',
149 'ilCronCheckUserAccounts::check' => array(
150 'classname' =>
'ilCronCheckUserAccounts',
152 'location' =>
'cron',
153 'condition' => $ilias->getSetting(
'cron_user_check')
157 'ilLuceneIndexer::index' => array(
158 'classname' =>
'ilLuceneIndexer',
160 'location' =>
'Services/Search',
161 'sub_location' =>
'Lucene',
162 'condition' => $ilias->getSetting(
"cron_lucene_index")
166 'ilCronLinkCheck::check' => array(
167 'classname' =>
'ilCronLinkCheck',
169 'location' =>
'cron',
170 'condition' => $ilias->getSetting(
"cron_link_check")
174 'ilCronWebResourceCheck::check' => array(
175 'classname' =>
'ilCronWebResourceCheck',
177 'location' =>
'cron',
178 'condition' => $ilias->getSetting(
"cron_web_resource_check")
182 'ilCronForumNotification::sendNotifications' => array(
183 'classname' =>
'ilCronForumNotification',
184 'method' =>
'sendNotifications',
185 'location' =>
'cron',
186 'condition' => ($ilias->getSetting(
'forum_notification') == 2)
190 'ilCronMailNotification::sendNotifications' => array(
191 'classname' =>
'ilCronMailNotification',
192 'method' =>
'sendNotifications',
193 'location' =>
'cron',
194 'condition' => ($ilias->getSetting(
'mail_notification') == 1)
198 'ilCronValidator::check' => array(
199 'classname' =>
'ilCronValidator',
201 'location' =>
'cron',
202 'condition' => ($ilias->getSetting(
'systemcheck_cron') == 1)
206 'ilCronDiskQuotaCheck::updateDiskUsageStatistics' => array(
207 'classname' =>
'ilCronDiskQuotaCheck',
208 'method' =>
'updateDiskUsageStatistics',
209 'location' =>
'cron',
214 'ilCronDiskQuotaCheck::sendReminderMails' => array(
215 'classname' =>
'ilCronDiskQuotaCheck',
216 'method' =>
'sendReminderMails',
217 'location' =>
'cron',
222 'ilCronDiskQuotaCheck::sendSummaryMails' => array(
223 'classname' =>
'ilCronDiskQuotaCheck',
224 'method' =>
'sendSummaryMails',
225 'location' =>
'cron',
233 #// Start Shopping Cart Check
234 #'ilPaymentShoppingCart::__deleteExpiredSessionsPSC' => array(
235 # 'classname' => 'ilPaymentShoppingCart',
236 # 'method' => '__deleteExpiredSessionsPSC',
237 # 'location' => 'Services/Payment',
238 # 'condition' => true
242 'ilCronDeleteInactiveUserAccounts::run' => array(
243 'classname' =>
'ilCronDeleteInactiveUserAccounts',
245 'location' =>
'Services/User',
246 'condition' => $ilias->getSetting(
'cron_inactive_user_delete', 0)