You are here

function node_import_requirements in Node import 6

Implementation of hook_requirements().

File

./node_import.install, line 465
Installs, upgrades or uninstalls the node_import module.

Code

function node_import_requirements($phase) {
  $requirements = array();
  $t = get_t();

  // Check minimum Drupal version.
  if (($phase == 'install' || $phase == 'runtime') && version_compare(VERSION, NODE_IMPORT_MINIMUM_DRUPAL) < 0) {
    $requirements['node_import:minimum_drupal'] = array(
      'title' => $t('Drupal version'),
      'description' => $t('Node import module requires Drupal %version or later (currently %drupal_version installed).', array(
        '%version' => NODE_IMPORT_MINIMUM_DRUPAL,
        '%drupal_version' => VERSION,
      )),
      'value' => VERSION,
      'severity' => REQUIREMENT_ERROR,
    );
  }

  // Check minimum DateAPI version.
  if ($phase == 'runtime' && variable_get('date_api_version', 0) < NODE_IMPORT_MINIMUM_DATEAPI) {
    $requirements['node_import:minimum_dateapi'] = array(
      'title' => $t('DateAPI version'),
      'description' => $t('Node import module requires DateAPI module %version or later (currently %date_version installed).', array(
        '%version' => NODE_IMPORT_MINIMUM_DATEAPI,
        '%date_version' => variable_get('date_api_version', 0),
      )),
      'value' => variable_get('date_api_version', 0),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}