You are here

function unicode_requirements in Drupal 7

Same name and namespace in other branches
  1. 8 core/includes/unicode.inc \unicode_requirements()
  2. 5 includes/unicode.inc \unicode_requirements()
  3. 6 includes/unicode.inc \unicode_requirements()

Returns Unicode library status and errors.

1 call to unicode_requirements()
system_requirements in modules/system/system.install
Implements hook_requirements().

File

includes/unicode.inc, line 139
Provides Unicode-related conversions and operations.

Code

function unicode_requirements() {

  // Ensure translations don't break during installation.
  $t = get_t();
  $libraries = array(
    UNICODE_SINGLEBYTE => $t('Standard PHP'),
    UNICODE_MULTIBYTE => $t('PHP Mbstring Extension'),
    UNICODE_ERROR => $t('Error'),
  );
  $severities = array(
    UNICODE_SINGLEBYTE => REQUIREMENT_WARNING,
    UNICODE_MULTIBYTE => REQUIREMENT_OK,
    UNICODE_ERROR => REQUIREMENT_ERROR,
  );
  list($library, $description) = _unicode_check();
  $requirements['unicode'] = array(
    'title' => $t('Unicode library'),
    'value' => $libraries[$library],
  );
  if ($description) {
    $requirements['unicode']['description'] = $description;
  }
  $requirements['unicode']['severity'] = $severities[$library];
  return $requirements;
}