easychart-8.x-3.5/easychart.install
easychart.install
<?php
/**
* @file
* Install and update hooks.
*/
/**
* Implements hook_requirements().
*/
function easychart_requirements($phase) {
$requirements = [];
if ($phase === 'runtime') {
$path = \Drupal::root() . '/libraries/easychart';
$exists = is_file($path . '/dist/ec.js');
$requirements['easychart_library'] = [
'title' => t('Easychart library'),
'description' => $exists ? '' : t('The <a href=":url">Easychart library</a> should be installed at <strong>/libraries/easychart/dist/ec.js</strong>, or any path supported by libraries.module if installed. Check out file or folder permissions if troubled.', [':url' => 'https://github.com/daemth/easychart/archive/master.zip']),
'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
'value' => $exists ? t('Installed') : t('Not installed'),
];
}
return $requirements;
}
