ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
hook_cron.php
Go to the documentation of this file.
1 <?php
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
oauth_hook_cron(&$croninfo)
Hook to run a cron job.
Definition: hook_cron.php:7
catch(Exception $e) $message
static warning($string)
Definition: Logger.php:177
static getOptionalConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.