You are here

function vbo_export_requirements in VBO export 7

Same name and namespace in other branches
  1. 8.3 vbo_export.install \vbo_export_requirements()
  2. 8 vbo_export.install \vbo_export_requirements()
  3. 8.2 vbo_export.install \vbo_export_requirements()

Implements hook_requirements().

File

./vbo_export.install, line 19
Module install procedures.

Code

function vbo_export_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {

    // Try to detect PHPExcel library.
    $library = libraries_detect('PHPExcel');
    if ($library && !empty($library['installed'])) {
      $requirements['PHPExcel'] = array(
        'title' => $t('PHPExcel library'),
        'value' => $library['version'],
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['PHPExcel'] = array(
        'title' => $t('PHPExcel library'),
        'value' => $t('Not found'),
        'description' => $t('In order to use vbo_export xlsx functionality you need to install the PHPExcel library.'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}