ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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}
static warning($string)
Definition: Logger.php:179
static notice($string)
Definition: Logger.php:190
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
$croninfo
Definition: cron.php:23
catch(Exception $e) $message
foreach($argv as $a) $aggregator
Definition: loganalyzer.php:53
$statconfig
Definition: showstats.php:4
$results
Definition: svg-scanner.php:47

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

+ Here is the call graph for this function: