You are here

blazy.install in Blazy 8

Same filename and directory in other branches
  1. 8.2 blazy.install
  2. 7 blazy.install

Installation actions for Blazy.

File

blazy.install
View source
<?php

/**
 * @file
 * Installation actions for Blazy.
 */

/**
 * Implements hook_requirements().
 */
function blazy_requirements($phase) {
  if ($phase != 'runtime') {
    return [];
  }
  $path = blazy_libraries_get_path('blazy') ?: \Drupal::root() . '/libraries/blazy';
  $exists = is_file($path . '/blazy.js');
  return [
    'blazy_library' => [
      'title' => t('Blazy library'),
      'description' => $exists ? '' : t('The <a href=":url">Blazy library</a> should be installed at <strong>/libraries/blazy/blazy.js</strong>, or any path supported by libraries.module if installed. Check out file or folder permissions if troubled.', [
        ':url' => 'https://github.com/dinbror/blazy',
      ]),
      'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      'value' => $exists ? t('Installed') : t('Not installed'),
    ],
  ];
}

Functions

Namesort descending Description
blazy_requirements Implements hook_requirements().