You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
826 B
39 lines
826 B
4 years ago
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @file
|
||
|
* Install, update and uninstall functions for the roblib_bee_limits module.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Implements hook_install().
|
||
|
*/
|
||
|
function roblib_bee_limits_install() {
|
||
|
\Drupal::messenger()->addStatus(__FUNCTION__);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Implements hook_uninstall().
|
||
|
*/
|
||
|
function roblib_bee_limits_uninstall() {
|
||
|
\Drupal::messenger()->addStatus(__FUNCTION__);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Implements hook_requirements().
|
||
|
*/
|
||
|
function roblib_bee_limits_requirements($phase) {
|
||
|
$requirements = [];
|
||
|
|
||
|
if ($phase == 'runtime') {
|
||
|
$value = mt_rand(0, 100);
|
||
|
$requirements['roblib_bee_limits_status'] = [
|
||
|
'title' => t('roblib_bee_limits status'),
|
||
|
'value' => t('roblib_bee_limits value: @value', ['@value' => $value]),
|
||
|
'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING,
|
||
|
];
|
||
|
}
|
||
|
|
||
|
return $requirements;
|
||
|
}
|