ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
hook_cron.php File Reference

Go to the source code of this file.

Functions

 statistics_hook_cron (&$croninfo)
 Hook to run a cron job. More...
 

Function Documentation

◆ statistics_hook_cron()

statistics_hook_cron ( $croninfo)

Hook to run a cron job.

Parameters
array&$croninfoOutput

Definition at line 7 of file hook_cron.php.

References $aggregator, $croninfo, $message, $results, $statconfig, SimpleSAML_Configuration\getConfig(), SimpleSAML\Logger\notice(), and SimpleSAML\Logger\warning().

8 {
9  assert(is_array($croninfo));
10  assert(array_key_exists('summary', $croninfo));
11  assert(array_key_exists('tag', $croninfo));
12 
13  $statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php');
14 
15  if (is_null($statconfig->getValue('cron_tag', null))) {
16  return;
17  }
18  if ($statconfig->getValue('cron_tag', null) !== $croninfo['tag']) {
19  return;
20  }
21 
22  $maxtime = $statconfig->getInteger('time_limit', null);
23  if ($maxtime) {
24  set_time_limit($maxtime);
25  }
26 
27  try {
29  $results = $aggregator->aggregate();
30  if (empty($results)) {
31  SimpleSAML\Logger::notice('Output from statistics aggregator was empty.');
32  } else {
33  $aggregator->store($results);
34  }
35  } catch (Exception $e) {
36  $message = 'Loganalyzer threw exception: ' . $e->getMessage();
38  $croninfo['summary'][] = $message;
39  }
40 }
foreach($argv as $a) $aggregator
Definition: loganalyzer.php:53
$croninfo
Definition: cron.php:23
$statconfig
Definition: showstats.php:4
static notice($string)
Definition: Logger.php:188
catch(Exception $e) $message
static warning($string)
Definition: Logger.php:177
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
$results
Definition: svg-scanner.php:47
+ Here is the call graph for this function: