You are here

function elf_requirements in External Links Filter 8

Same name and namespace in other branches
  1. 6.3 elf.install \elf_requirements()
  2. 7.3 elf.install \elf_requirements()

Implements hook_requirements().

File

./elf.install, line 11
Contains update functions for Elf module.

Code

function elf_requirements($phase) {
  $requirements = [];
  $loaded = extension_loaded('DOM');
  if ($loaded) {
    $requirements["elf_extension_dom"] = [
      'title' => 'DOM',
      'value' => t('DOM extension is loaded'),
      'severity' => REQUIREMENT_OK,
    ];
  }
  else {
    $requirements["elf_extension_dom"] = [
      'title' => 'DOM',
      'value' => t('DOM extension is not loaded'),
      'severity' => REQUIREMENT_ERROR,
      'description' => t('External Links Filter requires PHP\'s <a href="!url">Document Object Model</a>.', [
        '!url' => 'http://php.net/manual/en/book.dom.php',
      ]),
    ];
  }
  return $requirements;
}