You are here

function mobile_number_requirements in Mobile Number 8

Same name and namespace in other branches
  1. 7 mobile_number.install \mobile_number_requirements()
  2. 2.0.x mobile_number.install \mobile_number_requirements()

Implements hook_requirements().

File

./mobile_number.install, line 58
Install, update and uninstall functions for the systementity_configfield module.

Code

function mobile_number_requirements($phase) {
  $requirements = [];
  $requirements['mobile_number_library'] = [
    'title' => t('Libphonenumber-for-php library'),
  ];
  if (class_exists('\\libphonenumber\\PhoneNumber')) {
    $requirements['mobile_number_library']['value'] = t('Installed');
    $requirements['mobile_number_library']['severity'] = REQUIREMENT_OK;
  }
  else {
    $requirements['mobile_number_library']['value'] = t('Not Installed');
    $requirements['mobile_number_library']['severity'] = REQUIREMENT_ERROR;
    $requirements['mobile_number_library']['description'] = t('Please install the libphonenumber-for-php library via Composer.');
  }
  return $requirements;
}