cpf.install in CPF 8
Same filename and directory in other branches
Installation actions for CPF.
File
cpf.installView source
<?php
/**
* @file
* Installation actions for CPF.
*/
/**
* Implments hook_requirements().
*/
function cpf_requirements($phase) {
$requirements = [];
// Check to see if the jQuery Mask Plugin library is available.
if ($phase == 'runtime') {
$library = libraries_detect('mask_plugin');
if ($library && !empty($library['installed'])) {
if ($library['version']) {
$description = t('Version %i installed', [
'%i' => $library['version'],
]);
}
else {
$description = t('Unable to detect version.');
}
$requirements['mask_plugin'] = [
'title' => t('jQuery Mask Plugin'),
'description' => $description,
'severity' => REQUIREMENT_OK,
];
}
else {
$requirements['mask_plugin'] = [
'title' => t('jQuery Mask Plugin'),
'description' => t('jQuery Mask Plugin library not found. Please consult the README.md for installation instructions.'),
'severity' => REQUIREMENT_ERROR,
];
}
}
return $requirements;
}
Functions
Name | Description |
---|---|
cpf_requirements | Implments hook_requirements(). |