You are here

real_aes.install in Real AES 7

Same filename and directory in other branches
  1. 8.2 real_aes.install
  2. 8 real_aes.install
  3. 7.2 real_aes.install

Holds installation hooks for Real AES.

File

real_aes.install
View source
<?php

/**
 * @file
 * Holds installation hooks for Real AES.
 */

/**
 * Implements hook_requirements().
 */
function real_aes_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $requirements['real_aes_library'] = array(
      'title' => $t('Defuse PHP-Encryption library'),
    );
    $libraries = libraries_get_libraries();
    if (isset($libraries['php-encryption'])) {
      $requirements['real_aes_library']['value'] = $t('Installed');
      $requirements['real_aes_library']['severity'] = REQUIREMENT_OK;
    }
    else {
      $info = libraries_info('php-encryption');
      $requirements['real_aes_library']['value'] = $t('Not Installed');
      $requirements['real_aes_library']['severity'] = REQUIREMENT_WARNING;
      $requirements['real_aes_library']['description'] = $t('Please install the <a href="@url">PHP-encryption library</a>.', array(
        '@url' => $info['vendor_url'],
      ));
    }
  }
  return $requirements;
}

Functions

Namesort descending Description
real_aes_requirements Implements hook_requirements().