You are here

function telephone_validation_requirements in Telephone Validation 7

Same name and namespace in other branches
  1. 8.2 telephone_validation.install \telephone_validation_requirements()

Implements hook_requirements().

File

./telephone_validation.install, line 6

Code

function telephone_validation_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if (!module_exists('composer_manager') && !class_exists('\\libphonenumber\\PhoneNumberUtil')) {
    $requirements['telephone_validation'] = array(
      'title' => $t('libphonenumber library'),
      'description' => $t('Telephone Validation requires the <a href="@library_url">libphonenumber</a> library to be installed and autoloaded with composer (e.g. using the <a href="@composer_manager_url">composer_manager</a> module).', array(
        '@library_url' => 'https://github.com/giggsey/libphonenumber-for-php',
        '@composer_manager_url' => 'https://www.drupal.org/project/composer_manager',
      )),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}