function courier_requirements in Courier 2.x
Same name and namespace in other branches
- 8 courier.install \courier_requirements()
Implements hook_requirements().
File
- ./
courier.install, line 11 - Install functions for courier.
Code
function courier_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
$count = \Drupal::entityTypeManager()
->getStorage('courier_message_queue_item')
->getQuery()
->count()
->execute();
$requirements['courier'] = [
'title' => t('Courier'),
'severity' => REQUIREMENT_INFO,
'value' => \Drupal::translation()
->formatPlural($count, '@count item in queue.', '@count items in queue.'),
];
}
return $requirements;
}