function imagemagick_requirements in ImageMagick 8.3
Same name and namespace in other branches
- 8 imagemagick.install \imagemagick_requirements()
- 8.2 imagemagick.install \imagemagick_requirements()
Implements hook_requirements().
File
- ./
imagemagick.install, line 11 - ImageMagick installation scripts.
Code
function imagemagick_requirements($phase) {
$requirements = [];
if ($phase === 'install' && stripos(ini_get('disable_functions'), 'proc_open') !== FALSE) {
$reported_info = [];
// proc_open() is disabled.
$severity = REQUIREMENT_ERROR;
$reported_info[] = t("The <a href=':proc_open_url'>proc_open()</a> PHP function is disabled. It must be enabled for the toolkit to be installed. Edit the <a href=':disable_functions_url'>disable_functions</a> entry in your php.ini file, or consult your hosting provider.", [
':proc_open_url' => 'http://php.net/manual/en/function.proc-open.php',
':disable_functions_url' => 'http://php.net/manual/en/ini.core.php#ini.disable-functions',
]);
$requirements = [
'imagemagick' => [
'title' => t('ImageMagick'),
'description' => [
'#markup' => implode('<br />', $reported_info),
],
'severity' => $severity,
],
];
}
return $requirements;
}