You are here

telephone_formatter.install in Telephone Formatter 7

File

telephone_formatter.install
View source
<?php

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

Functions