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

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

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 }
$croninfo
Definition: cron.php:23
$oauthconfig
Definition: getUserInfo.php:5
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
catch(Exception $e) $message
static warning($string)
Definition: Logger.php:179
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
+ Here is the call graph for this function: