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');
 
  124                 $this->default_tasks = array(
 
  125                                 'ilLDAPCronSynchronization::start',
 
  126                                 'ilCronCheckUserAccounts::check',
 
  127                                 'ilLuceneIndexer::index',
 
  128                                 'ilCronLinkCheck::check',
 
  129                                 'ilCronWebResourceCheck::check',
 
  130                                 'ilCronForumNotification::sendNotifications',
 
  131                                 'ilCronMailNotification::sendNotifications',
 
  132                                 'ilCronValidator::check',
 
  133                                 'ilCronDiskQuotaCheck::updateDiskUsageStatistics',
 
  134                                 'ilCronDiskQuotaCheck::sendReminderMails',
 
  136                                 #
'ilPaymentShoppingCart::__deleteExpiredSessionsPSC',
 
  137                                 'ilCronDeleteInactiveUserAccounts::run' 
  140                 $this->possible_tasks = array(
 
  142                                 'ilLDAPCronSynchronization::start' => array(
 
  143                                         'classname'             => 
'ilLDAPCronSynchronization',
 
  145                                         'location'              => 
'Services/LDAP',
 
  150                                 'ilCronCheckUserAccounts::check' => array(
 
  151                                         'classname'             => 
'ilCronCheckUserAccounts',
 
  153                                         'location'              => 
'cron',
 
  154                                         'condition'             => $ilias->getSetting(
'cron_user_check')
 
  158                                 'ilLuceneIndexer::index' => array(
 
  159                                         'classname'             => 
'ilLuceneIndexer',
 
  161                                         'location'              => 
'Services/Search',
 
  162                                         'sub_location'  => 
'Lucene',
 
  163                                         'condition'             => $ilias->getSetting(
"cron_lucene_index")
 
  167                                 'ilCronLinkCheck::check' => array(
 
  168                                         'classname'             => 
'ilCronLinkCheck',
 
  170                                         'location'              => 
'cron',
 
  171                                         'condition'             => $ilias->getSetting(
"cron_link_check")
 
  175                                 'ilCronWebResourceCheck::check' => array(
 
  176                                         'classname'             => 
'ilCronWebResourceCheck',
 
  178                                         'location'              => 
'cron',
 
  179                                         'condition'             => $ilias->getSetting(
"cron_web_resource_check")
 
  183                                 'ilCronForumNotification::sendNotifications' => array(
 
  184                                         'classname'             => 
'ilCronForumNotification',
 
  185                                         'method'                => 
'sendNotifications',
 
  186                                         'location'              => 
'cron',
 
  187                                         'condition'             => ($ilias->getSetting(
'forum_notification') == 2)
 
  191                                 'ilCronMailNotification::sendNotifications' => array(
 
  192                                         'classname'             => 
'ilCronMailNotification',
 
  193                                         'method'                => 
'sendNotifications',
 
  194                                         'location'              => 
'cron',
 
  195                                         'condition'             => ($ilias->getSetting(
'mail_notification') == 1)
 
  199                                 'ilCronValidator::check' => array(
 
  200                                         'classname'             => 
'ilCronValidator',
 
  202                                         'location'              => 
'cron',
 
  203                                         'condition'             => ($ilias->getSetting(
'systemcheck_cron') == 1)
 
  207                                 'ilCronDiskQuotaCheck::updateDiskUsageStatistics' => array(
 
  208                                         'classname'             => 
'ilCronDiskQuotaCheck',
 
  209                                         'method'                => 
'updateDiskUsageStatistics',
 
  210                                         'location'              => 
'cron',
 
  215                                 'ilCronDiskQuotaCheck::sendReminderMails' => array(
 
  216                                         'classname'             => 
'ilCronDiskQuotaCheck',
 
  217                                         'method'                => 
'sendReminderMails',
 
  218                                         'location'              => 
'cron',
 
  223                                 'ilCronDiskQuotaCheck::sendSummaryMails' => array(
 
  224                                         'classname'             => 
'ilCronDiskQuotaCheck',
 
  225                                         'method'                => 
'sendSummaryMails',
 
  226                                         'location'              => 
'cron',
 
  234                                 #// Start Shopping Cart Check 
  235                                 #'ilPaymentShoppingCart::__deleteExpiredSessionsPSC' => array( 
  236                                 #       'classname'             => 'ilPaymentShoppingCart', 
  237                                 #       'method'                => '__deleteExpiredSessionsPSC', 
  238                                 #       'location'              => 'Services/Payment', 
  239                                 #       'condition'             => true 
  243                                 'ilCronDeleteInactiveUserAccounts::run' => array(
 
  244                                         'classname'             => 
'ilCronDeleteInactiveUserAccounts',
 
  246                                         'location'              => 
'Services/User',
 
  247                                         'condition'             => $ilias->getSetting(
'cron_inactive_user_delete', 0)