Go to the source code of this file.
◆ oauth_hook_cron()
oauth_hook_cron |
( |
& |
$croninfo | ) |
|
Hook to run a cron job.
- Parameters
-
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;
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();
28 }
29}
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
catch(Exception $e) $message
References $croninfo, $message, $oauthconfig, $store, SimpleSAML_Configuration\getOptionalConfig(), and SimpleSAML\Logger\warning().