52 $ilSetting->set(
'last_cronjob_start_ts', time());
54 if( $_SERVER[
'argc'] > 4 )
56 for($i = 4; $i < $_SERVER[
'argc']; $i++)
58 $arg = $_SERVER[
'argv'][$i];
60 if( !isset($this->possible_tasks[$arg]) )
61 throw new ilException(
'cron-task "'.$arg.
'" is not defined');
63 $task = $this->possible_tasks[$arg];
68 else foreach($this->default_tasks as $task)
70 $task = $this->possible_tasks[$task];
84 $classlocation = $task[
'location'].
'/classes';
85 if( isset($task[
'sub_location']) && strlen($task[
'sub_location']) )
87 $classlocation .=
'/'.$task[
'sub_location'];
89 $classfile .= $classlocation.
'/class.'.$task[
'classname'].
'.php';
91 $classname = $task[
'classname'];
92 $method = $task[
'method'];
94 $condition = $task[
'condition'];
100 if( !file_exists($classfile) )
101 throw new ilException(
'class file "'.$classfile.
'" does not exist');
103 require_once($classfile);
105 if( !class_exists($classname) )
106 throw new ilException(
'class "'.$classname.
'" does not exist');
108 if( !method_exists($classname, $method) )
109 throw new ilException(
'method "'.$classname.
'::'.$method.
'()" does not exist');
118 $ilLog->write(
"CRON - starting task: ".$classname.
"::".$method);
120 $task =
new $classname;
123 $ilLog->write(
"CRON - finished task: ".$classname.
"::".$method);
127 $ilLog->write(
"CRON - task condition failed: ".$classname.
"::".$method);
135 require_once(
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php');
136 require_once(
'Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php');
138 $this->default_tasks = array(
139 'ilLDAPCronSynchronization::start',
140 'ilCronCheckUserAccounts::check',
141 'ilLuceneIndexer::index',
142 'ilCronLinkCheck::check',
143 'ilCronWebResourceCheck::check',
144 'ilCronForumNotification::sendNotifications',
145 'ilCronMailNotification::sendNotifications',
146 'ilCronValidator::check',
147 'ilCronDiskQuotaCheck::updateDiskUsageStatistics',
148 'ilCronDiskQuotaCheck::sendReminderMails',
150 #
'ilPaymentShoppingCart::__deleteExpiredSessionsPSC',
151 'ilCronDeleteInactiveUserAccounts::run',
152 'ilCronDeleteInactivatedUserAccounts::run',
153 'ilCronPaymentNotification::sendNotifications',
154 'ilCronCourseGroupNotification::check',
155 'ilCronPaymentUDInvoiceNumberReset::check',
156 'ilCronObjectStatisticsCheck::check'
159 $this->possible_tasks = array(
161 'ilLDAPCronSynchronization::start' => array(
162 'classname' =>
'ilLDAPCronSynchronization',
164 'location' =>
'Services/LDAP',
169 'ilCronCheckUserAccounts::check' => array(
170 'classname' =>
'ilCronCheckUserAccounts',
172 'location' =>
'cron',
173 'condition' => $ilias->getSetting(
'cron_user_check')
177 'ilLuceneIndexer::index' => array(
178 'classname' =>
'ilLuceneIndexer',
180 'location' =>
'Services/Search',
181 'sub_location' =>
'Lucene',
182 'condition' => $ilias->getSetting(
"cron_lucene_index")
186 'ilCronLinkCheck::check' => array(
187 'classname' =>
'ilCronLinkCheck',
189 'location' =>
'cron',
190 'condition' => $ilias->getSetting(
"cron_link_check")
194 'ilCronWebResourceCheck::check' => array(
195 'classname' =>
'ilCronWebResourceCheck',
197 'location' =>
'cron',
198 'condition' => $ilias->getSetting(
"cron_web_resource_check")
202 'ilCronForumNotification::sendNotifications' => array(
203 'classname' =>
'ilCronForumNotification',
204 'method' =>
'sendNotifications',
205 'location' =>
'cron',
206 'condition' => ($ilias->getSetting(
'forum_notification') == 2)
210 'ilCronMailNotification::sendNotifications' => array(
211 'classname' =>
'ilCronMailNotification',
212 'method' =>
'sendNotifications',
213 'location' =>
'cron',
214 'condition' => ($ilias->getSetting(
'mail_notification') == 1)
218 'ilCronValidator::check' => array(
219 'classname' =>
'ilCronValidator',
221 'location' =>
'cron',
222 'condition' => ($ilias->getSetting(
'systemcheck_cron') == 1)
226 'ilCronDiskQuotaCheck::updateDiskUsageStatistics' => array(
227 'classname' =>
'ilCronDiskQuotaCheck',
228 'method' =>
'updateDiskUsageStatistics',
229 'location' =>
'cron',
234 'ilCronDiskQuotaCheck::sendReminderMails' => array(
235 'classname' =>
'ilCronDiskQuotaCheck',
236 'method' =>
'sendReminderMails',
237 'location' =>
'cron',
242 'ilCronDiskQuotaCheck::sendSummaryMails' => array(
243 'classname' =>
'ilCronDiskQuotaCheck',
244 'method' =>
'sendSummaryMails',
245 'location' =>
'cron',
253 #// Start Shopping Cart Check
254 #'ilPaymentShoppingCart::__deleteExpiredSessionsPSC' => array(
255 # 'classname' => 'ilPaymentShoppingCart',
256 # 'method' => '__deleteExpiredSessionsPSC',
257 # 'location' => 'Services/Payment',
258 # 'condition' => true
262 'ilCronDeleteInactiveUserAccounts::run' => array(
263 'classname' =>
'ilCronDeleteInactiveUserAccounts',
265 'location' =>
'Services/User',
266 'condition' => $ilias->getSetting(
'cron_inactive_user_delete', 0)
270 'ilCronDeleteInactivatedUserAccounts::run' => array(
271 'classname' =>
'ilCronDeleteInactivatedUserAccounts',
273 'location' =>
'Services/User',
274 'condition' => $ilias->getSetting(
'cron_inactivated_user_delete', 0)
278 'ilCronPaymentNotification::sendNotifications' => array(
279 'classname' =>
'ilCronPaymentNotification',
280 'method' =>
'sendNotifications',
281 'location' =>
'cron',
282 'condition' => ($ilias->getSetting(
'payment_notifications') == 1)
286 'ilCronCourseGroupNotification::check' => array(
287 'classname' =>
'ilCronCourseGroupNotification',
288 'method' =>
'sendNotifications',
289 'location' =>
'cron',
290 'condition' => $ilias->getSetting(
"crsgrp_ntf")
294 'ilCronPaymentUDInvoiceNumberReset::check' => array(
295 'classname' =>
'ilCronPaymentUDInvoiceNumberReset',
297 'location' =>
'cron',
302 'ilCronObjectStatisticsCheck::check' => array(
303 'classname' =>
'ilCronObjectStatisticsCheck',
305 'location' =>
'cron',