You are here

vbo_export.install in VBO export 7

Same filename and directory in other branches
  1. 8.3 vbo_export.install
  2. 8 vbo_export.install
  3. 8.2 vbo_export.install

Module install procedures.

File

vbo_export.install
View source
<?php

/**
 * @file
 * Module install procedures.
 */

/**
 * Implements hook_install().
 */
function vbo_export_install() {
  $dir = file_default_scheme() . '://vbo_export';
  file_prepare_directory($dir, FILE_CREATE_DIRECTORY);
}

/**
 * Implements hook_requirements().
 */
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;
}

Functions