function bootstrap_library_requirements in Bootstrap Library 8
Same name and namespace in other branches
- 7 bootstrap_library.module \bootstrap_library_requirements()
Implements hook_requirements().
File
- ./
bootstrap_library.install, line 20 - bootstrap_library.install Installation and update functions for the Bootstrap Library Module
Code
function bootstrap_library_requirements($phase) {
$requirements = array();
/*
if ($phase == 'runtime') {
$library = libraries_detect('bootstrap');
$error_type = isset($library['error']) ? Unicode::ucfirst($library['error']) : '';
$error_message = isset($library['error message']) ? $library['error message'] : '';
if (empty($library['installed'])) {
$requirements['bootstrap_plugin'] = array(
'title' => t('Bootstrap plugin'),
'value' => t('@e: At least @a', array('@e' => $error_type, '@a' => BOOTSTRAP_MIN_PLUGIN_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => t('!error You need to download the !bootstrap, extract the archive and place the bootstrap directory in the %path directory on your server.', array('!error' => $error_message, '!bootstrap' => \Drupal::l(t('bootstrap plugin'), Url::fromUri($library['download url'])), '%path' => 'sites/all/libraries')),
);
}
elseif (version_compare($library['version'], BOOTSTRAP_MIN_PLUGIN_VERSION, '>=')) {
$requirements['bootstrap_plugin'] = array(
'title' => t('Bootstrap plugin'),
'severity' => REQUIREMENT_OK,
'value' => $library['version'],
);
}
else {
$requirements['bootstrap_plugin'] = array(
'title' => t('Bootstrap plugin'),
'value' => t('At least @a', array('@a' => BOOTSTRAP_MIN_PLUGIN_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => t('You need to download a later version of the !bootstrap and replace the old version located in the %path directory on your server.', array('!bootstrap' => \Drupal::l(t('bootstrap plugin'), Url::fromUri($library['download url'])), '%path' => $library['library path'])),
);
}
}
*/
return $requirements;
}