You are here

function glossary_requirements in Glossary 7

Same name and namespace in other branches
  1. 5.2 glossary.install \glossary_requirements()
  2. 6 glossary.install \glossary_requirements()

Implements hook_requirements().

File

./glossary.install, line 18
Glossary module installation functions.

Code

function glossary_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();

  // Check that php is compiled with ctype support.
  $requirements['ctype'] = array(
    'title' => $t('Character type functions (ctype)'),
  );
  if (function_exists('ctype_alnum')) {
    $requirements['ctype']['value'] = $t('Enabled');
    $requirements['ctype']['severity'] = REQUIREMENT_OK;
  }
  else {
    $requirements['ctype']['value'] = $t('Disabled');
    $requirements['ctype']['description'] = $t('The Glossary module requires that you configure PHP with --enable-ctype.');
    $requirements['ctype']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}