You are here

function aes_get_available_aes_implementations in AES encryption 7

Same name and namespace in other branches
  1. 6 aes.install \aes_get_available_aes_implementations()

Retrieve information about available AES implementations.

Return value

array

2 calls to aes_get_available_aes_implementations()
aes_enable in ./aes.install
Implements hook_enable().
aes_requirements in ./aes.install
Implements hook_requirements().

File

./aes.install, line 49
Install/uninstall related functions.

Code

function aes_get_available_aes_implementations() {
  $phpsec_available = FALSE;
  if (module_exists('libraries') && libraries_get_path('phpseclib')) {
    $phpsec_include_path = libraries_get_path('phpseclib');
    set_include_path(get_include_path() . PATH_SEPARATOR . $phpsec_include_path);
    $phpsec_available = is_readable($phpsec_include_path . '/Crypt/AES.php');
  }
  $mcrypt_available = extension_loaded('mcrypt');
  return array(
    'mcrypt' => $mcrypt_available,
    'phpseclib' => $phpsec_available,
  );
}