You are here

imagemagick.install in ImageMagick 8.2

Same filename and directory in other branches
  1. 8.3 imagemagick.install
  2. 8 imagemagick.install
  3. 7 imagemagick.install

ImageMagick installation scripts.

File

imagemagick.install
View 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;
}

/**
 * Enable file_mdm module.
 */
function imagemagick_update_8201() {
  \Drupal::service('module_installer')
    ->install([
    'file_mdm',
  ]);
}

/**
 * Adds the 'prepend_pre_source' config setting.
 */
function imagemagick_update_8202() {
  $config_factory = \Drupal::configFactory();
  $setting = $config_factory
    ->getEditable('imagemagick.settings')
    ->set('prepend_pre_source', FALSE)
    ->save(TRUE);
}

/**
 * Clear caches to discover service changes.
 */
function imagemagick_update_8203() {

  // Empty function.
}

/**
 * Clear caches to discover service changes.
 */
function imagemagick_update_8204() {

  // Empty function.
}

Functions

Namesort descending Description
imagemagick_requirements Implements hook_requirements().
imagemagick_update_8201 Enable file_mdm module.
imagemagick_update_8202 Adds the 'prepend_pre_source' config setting.
imagemagick_update_8203 Clear caches to discover service changes.
imagemagick_update_8204 Clear caches to discover service changes.