ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Cron.php
Go to the documentation of this file.
1 <?php
2 
4 
8 class Cron
9 {
14  private $cronconfig;
15 
16  /*
17  * @param \SimpleSAML_Configuration $cronconfig The cron configuration to use. If not specified defaults
18  * to `config/module_cron.php`
19  */
21  {
22  if ($cronconfig == null) {
24  }
25  $this->cronconfig = $cronconfig;
26  }
27 
34  public function runTag($tag)
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  }
55 
56  public function isValidTag($tag)
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  }
63 }
$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
Handles interactions with SSP&#39;s cron system/hooks.
Definition: Cron.php:8
$summary
Definition: cron.php:24
__construct(\SimpleSAML_Configuration $cronconfig=null)
Definition: Cron.php:20
runTag($tag)
Invoke the cron hook for the given tag.
Definition: Cron.php:34
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
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