You are here

function lazy_requirements in Lazy-load 7

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

Implements hook_requirements().

File

./lazy.install, line 115
Install, update, and uninstall functions for the Lazy-load module.

Code

function lazy_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $blazy = libraries_detect('blazy');
    $requirements['blazy'] = array(
      'title' => $t('bLazy'),
    );
    if ($blazy['installed']) {
      $requirements['blazy']['value'] = $blazy['version'];
      $requirements['blazy']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['blazy']['value'] = $blazy['error'];
      $requirements['blazy']['description'] = $blazy['error message'];
      $requirements['blazy']['severity'] = REQUIREMENT_ERROR;
    }
    variable_set('lazy_library_installed', $blazy['installed']);
  }
  return $requirements;
}