advagg_ext_minify.install in Advanced CSS/JS Aggregation 8.2
Same filename and directory in other branches
Install, update and uninstall functions for the advagg_ext_minify module.
File
advagg_ext_minify/advagg_ext_minify.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the advagg_ext_minify module.
*/
/**
* Implements hook_requirements().
*/
function advagg_ext_minify_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
// Check that php's shell_exec works. `ls` is pretty cross-platform.
// Older Windows may not have it though so try `dir` as a backup.
if (!@shell_exec('ls') && !@shell_exec('dir')) {
$requirements['advagg_ext_min_shell_exec'] = [
'title' => t('PHP shell_exec'),
'severity' => REQUIREMENT_ERROR,
'description' => t('PHP shell_exec is non-functional. Check php.ini for safemode or <a href="@link" target="_blank">disable_functions</a>.', [
'@link' => 'http://php.net/manual/en/ini.core.php#ini.disable-functions',
]),
];
}
else {
$requirements['advagg_ext_min_shell_exec'] = [
'title' => t('PHP shell_exec'),
'severity' => REQUIREMENT_OK,
'description' => t('Enabled'),
];
}
}
return $requirements;
}
Functions
Name | Description |
---|---|
advagg_ext_minify_requirements | Implements hook_requirements(). |