You are here

function sheetnode_phpexcel_requirements in Sheetnode 5

Same name and namespace in other branches
  1. 6 modules/sheetnode_phpexcel/sheetnode_phpexcel.install \sheetnode_phpexcel_requirements()
  2. 7.2 modules/sheetnode_phpexcel/sheetnode_phpexcel.install \sheetnode_phpexcel_requirements()
  3. 7 modules/sheetnode_phpexcel/sheetnode_phpexcel.install \sheetnode_phpexcel_requirements()

Implementation of hook_requirements().

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.install, line 6

Code

function sheetnode_phpexcel_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $dir = rtrim(variable_get('sheetnode_phpexcel_library_path', ''), '/');
    $satisfied = is_dir($dir) && is_file($dir . '/Classes/PHPExcel.php');
    $requirements['sheetnode_phpexcel_library'] = array(
      'title' => $t('PHPExcel library'),
      'value' => $satisfied ? $t("PHPExcel is found.") : $t("PHPExcel is NOT found at !dir.", array(
        '!dir' => $dir,
      )),
      'severity' => $satisfied ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}