Hook to run a cron job.
9 assert(array_key_exists(
'summary',
$croninfo));
10 assert(array_key_exists(
'tag',
$croninfo));
19 $stateFile =
$config->getPathValue(
'datadir',
'data/') .
'metarefresh-state.php';
21 foreach (
$sets AS $setkey => $set) {
23 $cronTags = $set->getArray(
'cron');
24 if (!in_array(
$croninfo[
'tag'], $cronTags,
true))
continue;
28 $expireAfter = $set->getInteger(
'expireAfter', NULL);
29 if ($expireAfter !== NULL) {
30 $expire = time() + $expireAfter;
37 $outputFormat = $set->getValueValidate(
'outputFormat', array(
'flatfile',
'serialize'),
'flatfile');
40 'type' => $outputFormat,
46 # Get global blacklist, whitelist and caching info 47 $blacklist =
$mconfig->getArray(
'blacklist', array());
48 $whitelist =
$mconfig->getArray(
'whitelist', array());
49 $conditionalGET =
$mconfig->getBoolean(
'conditionalGET', FALSE);
52 $available_types = array(
57 'attributeauthority-remote' 59 $set_types = $set->getArrayize(
'types', $available_types);
61 foreach($set->getArray(
'sources') AS
$source) {
70 # Merge global and src specific blacklists 71 if(isset(
$source[
'blacklist'])) {
72 $source[
'blacklist'] = array_unique(array_merge(
$source[
'blacklist'], $blacklist));
74 $source[
'blacklist'] = $blacklist;
77 # Merge global and src specific whitelists 78 if(isset(
$source[
'whitelist'])) {
79 $source[
'whitelist'] = array_unique(array_merge(
$source[
'whitelist'], $whitelist));
81 $source[
'whitelist'] = $whitelist;
84 # Let src specific conditionalGET override global one 85 if(!isset(
$source[
'conditionalGET'])) {
86 $source[
'conditionalGET'] = $conditionalGET;
96 switch ($outputFormat) {
105 if ($set->hasValue(
'arp')) {
112 $croninfo[
'summary'][] =
'Error during metarefresh: ' . $e->getMessage();
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.