| Conditions | 5 |
| Paths | 6 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | function aggregator2_hook_cron(array &$croninfo): void |
||
| 13 | { |
||
| 14 | assert('array_key_exists("summary", $croninfo)'); |
||
| 15 | assert('array_key_exists("tag", $croninfo)'); |
||
| 16 | |||
| 17 | $cronTag = $croninfo['tag']; |
||
| 18 | |||
| 19 | $config = Configuration::getConfig('module_aggregator2.php'); |
||
| 20 | $config = $config->toArray(); |
||
| 21 | |||
| 22 | foreach ($config as $id => $c) { |
||
| 23 | if (!isset($c['cron.tag'])) { |
||
| 24 | continue; |
||
| 25 | } |
||
| 26 | if ($c['cron.tag'] !== $cronTag) { |
||
| 27 | continue; |
||
| 28 | } |
||
| 29 | |||
| 30 | try { |
||
| 31 | $a = Aggregator::getAggregator($id); |
||
| 32 | $a->updateCache(); |
||
| 33 | } catch (Exception $e) { |
||
| 34 | $croninfo['summary'][] = 'Error during aggregator2 cacheupdate: ' . $e->getMessage(); |
||
| 35 | } |
||
| 38 |