bootstrap_library.install in Bootstrap Library 8
Same filename and directory in other branches
bootstrap_library.install Installation and update functions for the Bootstrap Library Module
File
bootstrap_library.installView source
<?php
/**
* @file bootstrap_library.install
* Installation and update functions for the Bootstrap Library
* Module
*/
/**
* @file
* Install, update and uninstall functions for the bootstrap module.
*/
use Drupal\Core\Url;
use Drupal\Component\Utility\Unicode;
/**
* Implements hook_requirements().
*/
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;
}
Functions
Name | Description |
---|---|
bootstrap_library_requirements | Implements hook_requirements(). |