imagemagick.install in ImageMagick 8.3
Same filename and directory in other branches
ImageMagick installation scripts.
File
imagemagick.installView source
<?php
/**
* @file
* ImageMagick installation scripts.
*/
/**
* Implements hook_requirements().
*/
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;
}
/**
* Minimum 2.x schema version to allow upgrading from.
*/
function imagemagick_update_last_removed() {
return 8203;
}
/**
* Adds the 'advanced.coalesce' config setting.
*/
function imagemagick_update_8301() {
$config_factory = \Drupal::configFactory();
$setting = $config_factory
->getEditable('imagemagick.settings')
->set('advanced.coalesce', FALSE)
->save(TRUE);
}
/**
* Remove the 'prepend_pre_source' and 'use_identify' config settings.
*/
function imagemagick_update_8302() {
$config_factory = \Drupal::configFactory();
$setting = $config_factory
->getEditable('imagemagick.settings')
->clear('prepend_pre_source')
->clear('use_identify')
->save(TRUE);
}
/**
* Enable the Sophron module.
*/
function imagemagick_update_8303() {
\Drupal::service('module_installer')
->install([
'sophron',
]);
}
Functions
Name | Description |
---|---|
imagemagick_requirements | Implements hook_requirements(). |
imagemagick_update_8301 | Adds the 'advanced.coalesce' config setting. |
imagemagick_update_8302 | Remove the 'prepend_pre_source' and 'use_identify' config settings. |
imagemagick_update_8303 | Enable the Sophron module. |
imagemagick_update_last_removed | Minimum 2.x schema version to allow upgrading from. |