ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
hook_cron.php File Reference

Go to the source code of this file.

Functions

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

Function Documentation

◆ sanitycheck_hook_cron()

sanitycheck_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 SimpleSAML\Logger::info('cron [sanitycheck]: Running cron in cron tag [' . $croninfo['tag'] . '] ');
14
15 try {
16 $sconfig = SimpleSAML_Configuration::getOptionalConfig('config-sanitycheck.php');
17
18 $cronTag = $sconfig->getString('cron_tag', null);
19 if ($cronTag === null || $cronTag !== $croninfo['tag']) {
20 return;
21 }
22
23 $info = array();
24 $errors = array();
25 $hookinfo = array(
26 'info' => &$info,
27 'errors' => &$errors,
28 );
29
31
32 if (count($errors) > 0) {
33 foreach ($errors AS $err) {
34 $croninfo['summary'][] = 'Sanitycheck error: ' . $err;
35 }
36 }
37
38 } catch (Exception $e) {
39 $croninfo['summary'][] = 'Error executing sanity check: ' . $e->getMessage();
40 }
41}
static info($string)
Definition: Logger.php:201
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:364
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
$croninfo
Definition: cron.php:23
$errors
Definition: index.php:6
$hookinfo
Definition: index.php:7
$info
Definition: index.php:5

References $croninfo, $errors, $hookinfo, $info, SimpleSAML\Module\callHooks(), SimpleSAML_Configuration\getOptionalConfig(), and SimpleSAML\Logger\info().

+ Here is the call graph for this function: