ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 ( )

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

References $ilLog, and initTasks().

{
global $ilLog;
$this->log = $ilLog;
$this->initTasks();
}

+ Here is the call graph for this function:

ilCronCheck::initTasks ( )
private

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

Referenced by ilCronCheck().

{
global $ilias;
require_once('Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php');
$this->default_tasks = array(
'ilCronValidator::check'
);
$this->possible_tasks = array(
// Start System Check
'ilCronValidator::check' => array(
'classname' => 'ilCronValidator',
'method' => 'check',
'location' => 'cron',
'condition' => ($ilias->getSetting('systemcheck_cron') == 1)
)
);
}

+ Here is the caller graph for this function:

ilCronCheck::runTask (   $task)
private

prepare task information

check if task is runable

run task

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

References $ilLog.

Referenced by start().

{
global $ilLog;
$classlocation = $task['location'].'/classes';
if( isset($task['sub_location']) && strlen($task['sub_location']) )
{
$classlocation .= '/'.$task['sub_location'];
}
$classfile .= $classlocation.'/class.'.$task['classname'].'.php';
$classname = $task['classname'];
$method = $task['method'];
$condition = $task['condition'];
if( !file_exists($classfile) )
throw new ilException('class file "'.$classfile.'" does not exist');
require_once($classfile);
if( !class_exists($classname) )
throw new ilException('class "'.$classname.'" does not exist');
if( !method_exists($classname, $method) )
throw new ilException('method "'.$classname.'::'.$method.'()" does not exist');
if($condition)
{
$ilLog->write("CRON - starting task: ".$classname."::".$method);
$task = new $classname;
$task->$method();
$ilLog->write("CRON - finished task: ".$classname."::".$method);
}
else
{
$ilLog->write("CRON - task condition failed: ".$classname."::".$method);
}
}

+ Here is the caller graph for this function:

ilCronCheck::start ( )

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

References runTask().

{
/* MOVED TO: ilCronManager::runActiveJobs();
global $ilSetting;
$ilSetting->set('last_cronjob_start_ts', time());
*/
if( $_SERVER['argc'] > 4 )
{
for($i = 4; $i < $_SERVER['argc']; $i++)
{
$arg = $_SERVER['argv'][$i];
if( !isset($this->possible_tasks[$arg]) )
throw new ilException('cron-task "'.$arg.'" is not defined');
$task = $this->possible_tasks[$arg];
$this->runTask($task);
}
}
else foreach($this->default_tasks as $task)
{
$task = $this->possible_tasks[$task];
$this->runTask($task);
}
}

+ Here is the call graph for this function:

Field Documentation

ilCronCheck::$default_tasks = array()
private

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

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: