ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCronCheck Class Reference
+ Collaboration diagram for ilCronCheck:

Public Member Functions

 ilCronCheck ()
 
 start ()
 

Private Member Functions

 runTask ($task)
 
 initTasks ()
 

Private Attributes

 $possible_tasks = array()
 
 $default_tasks = array()
 

Detailed Description

Definition at line 34 of file class.ilCronCheck.php.

Member Function Documentation

◆ ilCronCheck()

ilCronCheck::ilCronCheck ( )

Definition at line 39 of file class.ilCronCheck.php.

40 {
41 global $ilLog;
42
43 $this->log = $ilLog;
44
45 $this->initTasks();
46 }

References $ilLog, and initTasks().

+ Here is the call graph for this function:

◆ initTasks()

ilCronCheck::initTasks ( )
private

Definition at line 133 of file class.ilCronCheck.php.

134 {
135 global $ilias;
136
137 require_once('Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php');
138
139 $this->default_tasks = array(
140 'ilCronValidator::check'
141 );
142
143 $this->possible_tasks = array(
144
145 // Start System Check
146 'ilCronValidator::check' => array(
147 'classname' => 'ilCronValidator',
148 'method' => 'check',
149 'location' => 'cron',
150 'condition' => ($ilias->getSetting('systemcheck_cron') == 1)
151 )
152 );
153 }

Referenced by ilCronCheck().

+ Here is the caller graph for this function:

◆ runTask()

ilCronCheck::runTask (   $task)
private

prepare task information

check if task is runable

run task

Definition at line 78 of file class.ilCronCheck.php.

79 {
80 global $ilLog;
81
86 $classlocation = $task['location'].'/classes';
87 if( isset($task['sub_location']) && strlen($task['sub_location']) )
88 {
89 $classlocation .= '/'.$task['sub_location'];
90 }
91 $classfile .= $classlocation.'/class.'.$task['classname'].'.php';
92
93 $classname = $task['classname'];
94 $method = $task['method'];
95
96 $condition = $task['condition'];
97
102 if( !file_exists($classfile) )
103 throw new ilException('class file "'.$classfile.'" does not exist');
104
105 require_once($classfile);
106
107 if( !class_exists($classname) )
108 throw new ilException('class "'.$classname.'" does not exist');
109
110 if( !method_exists($classname, $method) )
111 throw new ilException('method "'.$classname.'::'.$method.'()" does not exist');
112
118 if($condition)
119 {
120 $ilLog->write("CRON - starting task: ".$classname."::".$method);
121
122 $task = new $classname;
123 $task->$method();
124
125 $ilLog->write("CRON - finished task: ".$classname."::".$method);
126 }
127 else
128 {
129 $ilLog->write("CRON - task condition failed: ".$classname."::".$method);
130 }
131 }
Base class for ILIAS Exception handling.
$task
GENERAL INFORMATION:

References $ilLog, and $task.

Referenced by start().

+ Here is the caller graph for this function:

◆ start()

ilCronCheck::start ( )

Definition at line 48 of file class.ilCronCheck.php.

49 {
50 /* MOVED TO: ilCronManager::runActiveJobs();
51 global $ilSetting;
52
53 $ilSetting->set('last_cronjob_start_ts', time());
54 */
55
56 if( $_SERVER['argc'] > 4 )
57 {
58 for($i = 4; $i < $_SERVER['argc']; $i++)
59 {
60 $arg = $_SERVER['argv'][$i];
61
62 if( !isset($this->possible_tasks[$arg]) )
63 throw new ilException('cron-task "'.$arg.'" is not defined');
64
65 $task = $this->possible_tasks[$arg];
66
67 $this->runTask($task);
68 }
69 }
70 else foreach($this->default_tasks as $task)
71 {
72 $task = $this->possible_tasks[$task];
73
74 $this->runTask($task);
75 }
76 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, $task, and runTask().

+ Here is the call graph for this function:

Field Documentation

◆ $default_tasks

ilCronCheck::$default_tasks = array()
private

Definition at line 37 of file class.ilCronCheck.php.

◆ $possible_tasks

ilCronCheck::$possible_tasks = array()
private

Definition at line 36 of file class.ilCronCheck.php.


The documentation for this class was generated from the following file: