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');
113 $task =
new $classname;
122 require_once(
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php');
123 require_once(
'Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php');
125 $this->default_tasks = array(
126 'ilLDAPCronSynchronization::start',
127 'ilCronCheckUserAccounts::check',
128 'ilLuceneIndexer::index',
129 'ilCronLinkCheck::check',
130 'ilCronWebResourceCheck::check',
131 'ilCronForumNotification::sendNotifications',
132 'ilCronMailNotification::sendNotifications',
133 'ilCronValidator::check',
134 'ilCronDiskQuotaCheck::updateDiskUsageStatistics',
135 'ilCronDiskQuotaCheck::sendReminderMails',
137 #
'ilPaymentShoppingCart::__deleteExpiredSessionsPSC',
138 'ilCronDeleteInactiveUserAccounts::run',
139 'ilCronPaymentNotification::sendNotifications',
140 'ilCronCourseGroupNotification::check',
141 'ilCronPaymentUDInvoiceNumberReset::check'
144 $this->possible_tasks = array(
146 'ilLDAPCronSynchronization::start' => array(
147 'classname' =>
'ilLDAPCronSynchronization',
149 'location' =>
'Services/LDAP',
154 'ilCronCheckUserAccounts::check' => array(
155 'classname' =>
'ilCronCheckUserAccounts',
157 'location' =>
'cron',
158 'condition' => $ilias->getSetting(
'cron_user_check')
162 'ilLuceneIndexer::index' => array(
163 'classname' =>
'ilLuceneIndexer',
165 'location' =>
'Services/Search',
166 'sub_location' =>
'Lucene',
167 'condition' => $ilias->getSetting(
"cron_lucene_index")
171 'ilCronLinkCheck::check' => array(
172 'classname' =>
'ilCronLinkCheck',
174 'location' =>
'cron',
175 'condition' => $ilias->getSetting(
"cron_link_check")
179 'ilCronWebResourceCheck::check' => array(
180 'classname' =>
'ilCronWebResourceCheck',
182 'location' =>
'cron',
183 'condition' => $ilias->getSetting(
"cron_web_resource_check")
187 'ilCronForumNotification::sendNotifications' => array(
188 'classname' =>
'ilCronForumNotification',
189 'method' =>
'sendNotifications',
190 'location' =>
'cron',
191 'condition' => ($ilias->getSetting(
'forum_notification') == 2)
195 'ilCronMailNotification::sendNotifications' => array(
196 'classname' =>
'ilCronMailNotification',
197 'method' =>
'sendNotifications',
198 'location' =>
'cron',
199 'condition' => ($ilias->getSetting(
'mail_notification') == 1)
203 'ilCronValidator::check' => array(
204 'classname' =>
'ilCronValidator',
206 'location' =>
'cron',
207 'condition' => ($ilias->getSetting(
'systemcheck_cron') == 1)
211 'ilCronDiskQuotaCheck::updateDiskUsageStatistics' => array(
212 'classname' =>
'ilCronDiskQuotaCheck',
213 'method' =>
'updateDiskUsageStatistics',
214 'location' =>
'cron',
219 'ilCronDiskQuotaCheck::sendReminderMails' => array(
220 'classname' =>
'ilCronDiskQuotaCheck',
221 'method' =>
'sendReminderMails',
222 'location' =>
'cron',
227 'ilCronDiskQuotaCheck::sendSummaryMails' => array(
228 'classname' =>
'ilCronDiskQuotaCheck',
229 'method' =>
'sendSummaryMails',
230 'location' =>
'cron',
238 #// Start Shopping Cart Check
239 #'ilPaymentShoppingCart::__deleteExpiredSessionsPSC' => array(
240 # 'classname' => 'ilPaymentShoppingCart',
241 # 'method' => '__deleteExpiredSessionsPSC',
242 # 'location' => 'Services/Payment',
243 # 'condition' => true
247 'ilCronDeleteInactiveUserAccounts::run' => array(
248 'classname' =>
'ilCronDeleteInactiveUserAccounts',
250 'location' =>
'Services/User',
251 'condition' => $ilias->getSetting(
'cron_inactive_user_delete', 0)
255 'ilCronPaymentNotification::sendNotifications' => array(
256 'classname' =>
'ilCronPaymentNotification',
257 'method' =>
'sendNotifications',
258 'location' =>
'cron',
259 'condition' => ($ilias->getSetting(
'payment_notifications') == 1)
263 'ilCronCourseGroupNotification::check' => array(
264 'classname' =>
'ilCronCourseGroupNotification',
265 'method' =>
'sendNotifications',
266 'location' =>
'cron',
267 'condition' => $ilias->getSetting(
"crsgrp_ntf")
271 'ilCronPaymentUDInvoiceNumberReset::check' => array(
272 'classname' =>
'ilCronPaymentUDInvoiceNumberReset',
274 'location' =>
'cron',