function bynder_requirements in Bynder 8
Same name and namespace in other branches
- 8.3 bynder.install \bynder_requirements()
- 8.2 bynder.install \bynder_requirements()
- 4.0.x bynder.install \bynder_requirements()
Implements hook_requirements().
File
- ./
bynder.install, line 11 - Install, uninstall and update hooks for Bynder module.
Code
function bynder_requirements($phase) {
$requirements = [];
$imagesloaded_path = DRUPAL_ROOT . '/libraries/imagesloaded/imagesloaded.pkgd.min.js';
$masonry_path = DRUPAL_ROOT . '/libraries/masonry/dist/masonry.pkgd.min.js';
if (!file_exists($imagesloaded_path)) {
$requirements['imagesloaded'] = array(
'title' => t('ImagesLoaded library missing'),
'description' => t('Bynder requires the imagesLoaded library. Download the newest release from https://github.com/desandro/imagesloaded releases and place it in /libraries'),
'severity' => REQUIREMENT_ERROR,
);
}
if (!file_exists($masonry_path)) {
$requirements['masonry'] = array(
'title' => t('Masonry library missing'),
'description' => t('Bynder requires the Masonry library. Download the newest release from https://github.com/desandro/masonry/releases and place it in /libraries'),
'severity' => REQUIREMENT_ERROR,
);
}
return $requirements;
}