You are here

telephone_validation.install in Telephone Validation 7

Same filename and directory in other branches
  1. 8.2 telephone_validation.install

File

telephone_validation.install
View source
<?php

/**
 * Implements hook_requirements().
 */
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;
}

Functions