ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML\Module\cron\Cron Class Reference

Handles interactions with SSP's cron system/hooks. More...

+ Collaboration diagram for SimpleSAML\Module\cron\Cron:

Public Member Functions

 __construct (\SimpleSAML_Configuration $cronconfig=null)
 
 runTag ($tag)
 Invoke the cron hook for the given tag. More...
 
 isValidTag ($tag)
 

Private Attributes

 $cronconfig
 

Detailed Description

Handles interactions with SSP's cron system/hooks.

Definition at line 8 of file Cron.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML\Module\cron\Cron::__construct ( \SimpleSAML_Configuration  $cronconfig = null)

Definition at line 20 of file Cron.php.

References SimpleSAML\Module\cron\Cron\$cronconfig, and SimpleSAML_Configuration\getConfig().

21  {
22  if ($cronconfig == null) {
24  }
25  $this->cronconfig = $cronconfig;
26  }
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
+ Here is the call graph for this function:

Member Function Documentation

◆ isValidTag()

SimpleSAML\Module\cron\Cron::isValidTag (   $tag)

Definition at line 56 of file Cron.php.

References $tag.

Referenced by SimpleSAML\Module\cron\Cron\runTag().

57  {
58  if (!is_null($this->cronconfig->getValue('allowed_tags'))) {
59  return in_array($tag, $this->cronconfig->getArray('allowed_tags'), true);
60  }
61  return true;
62  }
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
+ Here is the caller graph for this function:

◆ runTag()

SimpleSAML\Module\cron\Cron::runTag (   $tag)

Invoke the cron hook for the given tag.

Parameters
$tagstring The tag to use. Must be valid in the cronConfig
Returns
array the tag, and summary information from the run.
Exceptions
ExceptionIf an invalid tag specified

Definition at line 34 of file Cron.php.

References $croninfo, $s, $summary, $tag, array, SimpleSAML\Module\callHooks(), SimpleSAML\Logger\debug(), and SimpleSAML\Module\cron\Cron\isValidTag().

35  {
36 
37  if (!$this->isValidTag($tag)) {
38  throw new \Exception("Invalid cron tag '$tag''");
39  }
40 
41  $summary = array();
42  $croninfo = array(
43  'summary' => &$summary,
44  'tag' => $tag,
45  );
46 
48 
49  foreach ($summary as $s) {
50  \SimpleSAML\Logger::debug('Cron - Summary: ' . $s);
51  }
52 
53  return $croninfo;
54  }
$croninfo
Definition: cron.php:23
static debug($string)
Definition: Logger.php:213
$s
Definition: pwgen.php:45
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:364
$summary
Definition: cron.php:24
Create styles array
The data for the language used.
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
+ Here is the call graph for this function:

Field Documentation

◆ $cronconfig

SimpleSAML\Module\cron\Cron::$cronconfig
private

Definition at line 14 of file Cron.php.

Referenced by SimpleSAML\Module\cron\Cron\__construct().


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