You are here

function telephone_formatter_requirements in Telephone Formatter 7

Implements hook_requirements().

File

./telephone_formatter.install, line 6

Code

function telephone_formatter_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if (!module_exists('composer_manager') && !class_exists('\\libphonenumber\\PhoneNumberUtil')) {
    $requirements['telephone_formatter'] = array(
      'title' => $t('libphonenumber library'),
      'description' => $t('Telephone Formatter 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;
}