You are here

function feeds_excel_requirements in Feeds Excel 6

Same name and namespace in other branches
  1. 7.2 feeds_excel.install \feeds_excel_requirements()
  2. 7 feeds_excel.install \feeds_excel_requirements()

Implements hook_requirements().

File

./feeds_excel.install, line 6

Code

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

  // Ensure translations don't break at install time
  $t = get_t();
  if (!module_exists('libraries')) {
    $requirements['feeds_excel:libraries'] = array(
      'title' => $t('Feeds Excel'),
      'description' => $t('The Libraries API module is not enabled. Please make sure it is downloaded (from http://drupal.org/project/libraries) and enabled.'),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  $path = !module_exists('libraries') ? 'sites/all/libraries/phpExcelReader' : libraries_get_path('phpExcelReader');
  if (!file_exists($path . '/Excel/reader.php')) {
    $requirements['feeds_excel:libraries'] = array(
      'title' => $t('phpExcelReader'),
      'description' => $t('The phpExcelReader library is not located in %path!. You can download it from !link. For more information look in Feeds Excel\'s README.txt.', array(
        '%path' => $path,
        '!link' => l(t('here'), 'https://github.com/derhasi/phpExcelReader/zipball/interim2'),
      )),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}