bootstrap_languages.install in Bootstrap Languages 8
Same filename and directory in other branches
Install, update and uninstall functions for the Bootstrap Languages module.
File
bootstrap_languages.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Bootstrap Languages module.
*/
/**
* Implements hook_requirements().
*/
function bootstrap_languages_requirements($phase) {
if ($phase != 'runtime') {
return [];
}
$library = \Drupal::service('library.discovery')
->getLibraryByName('bootstrap_languages', 'bootstrap-languages');
$library_exists = file_exists(DRUPAL_ROOT . '/' . $library['css'][0]['data']);
return [
'bootstrap_languages_library_downloaded' => [
'title' => t('Bootstrap Languages library'),
'value' => $library_exists ? t('Installed') : t('Not installed'),
'description' => $library_exists ? '' : t('The Bootstrap Languages library needs to be <a href="@url">downloaded</a> and extracted into the /libraries/bootstrap-languages folder in your Drupal installation directory.', [
'@url' => 'https://github.com/usrz/bootstrap-languages/archive/master.zip',
]),
'severity' => $library_exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
],
];
}
Functions
Name | Description |
---|---|
bootstrap_languages_requirements | Implements hook_requirements(). |