You are here

function synonyms_requirements in Synonyms 7

Implements hook_requirements().

File

./synonyms.install, line 77
Install, update, and uninstall functions for the Synonyms module.

Code

function synonyms_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'update':

      // Synonyms has changed its dependencies. It used to be Taxonomy and now
      // it is Entity module. We make sure Entity is enabled otherwise we halt
      // the update for Synonyms.
      // TODO: remove this requirement check at some point, when it becomes
      // obsolete.
      $t = get_t();
      $requirements['synonyms_entity_dependency'] = array(
        'title' => $t('Synonyms depends on Entity'),
        'description' => $t('Synonyms module depends on Entity module since 4-Mar-2016. At the same time it no longer depends on Taxonomy module while does integrate with the latter. If you do not have installed/enabled Entity module, do so before running updates on Synonyms module. Until Entity module is enabled and updates are executed, Synonyms module performance may degrade and even trigger PHP errors. See <a href="@url">@url</a> for more info.', array(
          '@url' => 'https://www.drupal.org/node/1194802',
        )),
        'value' => module_exists('entity') ? $t('Passed') : $t('Failed'),
        'severity' => module_exists('entity') ? REQUIREMENT_INFO : REQUIREMENT_ERROR,
      );
      break;
  }
  return $requirements;
}