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

Go to the source code of this file.

Functions

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

Function Documentation

◆ oauth_hook_cron()

oauth_hook_cron ( $croninfo)

Hook to run a cron job.

Parameters
array&$croninfoOutput

Definition at line 7 of file hook_cron.php.

7 {
8 assert(is_array($croninfo));
9 assert(array_key_exists('summary', $croninfo));
10 assert(array_key_exists('tag', $croninfo));
11
13
14 if (is_null($oauthconfig->getValue('cron_tag', 'hourly'))) return;
15 if ($oauthconfig->getValue('cron_tag', NULL) !== $croninfo['tag']) return;
16
17 try {
19 $cleaned = $store->removeExpired();
20
21# if ($cleaned > 0)
22 $croninfo['summary'][] = 'OAuth clean up. Removed ' . $cleaned . ' expired entries from OAuth storage.';
23
24 } catch (Exception $e) {
25 $message = 'OAuth clean up cron script failed: ' . $e->getMessage();
27 $croninfo['summary'][] = $message;
28 }
29}
static warning($string)
Definition: Logger.php:177
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
$oauthconfig
Definition: getUserInfo.php:5
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
$croninfo
Definition: cron.php:23
catch(Exception $e) $message

References $croninfo, $message, $oauthconfig, $store, SimpleSAML_Configuration\getOptionalConfig(), and SimpleSAML\Logger\warning().

+ Here is the call graph for this function: