function gelf_requirements in GELF 6
Same name and namespace in other branches
- 8 gelf.install \gelf_requirements()
- 7 gelf.install \gelf_requirements()
Implements hook_requirements().
Indicate whether the gelf library requirement is met.
File
- ./
gelf.install, line 12 - Install functions for the gelf module.
Code
function gelf_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$gelflib_path = libraries_get_path('gelf-php');
if (!file_exists($gelflib_path . '/GELFMessage.php') || !file_exists($gelflib_path . '/GELFMessagePublisher.php')) {
$requirements['gelf'] = array(
'value' => t('Not installed'),
'severity' => REQUIREMENT_ERROR,
'description' => t('GELF module requires the GELF PHP library to be installed. View the README in the GELF module directory for installation instructions.'),
);
}
else {
$requirements['gelf'] = array(
'value' => t('Installed'),
'severity' => REQUIREMENT_OK,
);
}
$requirements['gelf']['title'] = t('GELF-PHP Library');
}
return $requirements;
}