You are here

telephone_validation.install in Telephone Validation 8.2

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

Installation hooks.

File

telephone_validation.install
View source
<?php

/**
 * @file
 * Installation hooks.
 */

/**
 * Implements hook_requirements().
 */
function telephone_validation_requirements($phase) {
  $requirements = [];
  if ($phase == 'install') {
    if (!class_exists('\\libphonenumber\\PhoneNumberUtil')) {
      $requirements['telephone_validation'] = [
        'title' => t('Composer dependencies'),
        'description' => t('This module can be only installed with Composer as it uses composer dependencies. Read more on https://www.drupal.org/node/2718229'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}

Functions