You are here

image_effects.install in Image Effects 8.2

Same filename and directory in other branches
  1. 8.3 image_effects.install
  2. 8 image_effects.install

Install, update and uninstall functions for the image_effects module.

File

image_effects.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the image_effects module.
 */

/**
 * Implements hook_requirements().
 */
function image_effects_requirements($phase) {
  $requirements = [];

  // Check PHP GD2 FreeType support.
  if (function_exists('gd_info')) {
    $info = gd_info();
    if (!function_exists('imagettftext') || !isset($info["FreeType Support"])) {

      // No FreeType support, raise warning.
      $requirements['image_effects_gd_freetype'] = [
        'title' => t('GD library FreeType support'),
        'value' => t('Not installed'),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('The GD Library for PHP is enabled, but was compiled without FreeType support. Image effects using fonts will not be available with the GD image toolkit.'),
      ];
    }
  }
  return $requirements;
}

/**
 * Minimum 1.x schema version to allow upgrading from.
 */
function image_effects_update_last_removed() {
  return 8004;
}

/**
 * Enable file_mdm module and required submodules.
 */
function image_effects_update_8201() {
  \Drupal::service('module_installer')
    ->install([
    'file_mdm',
    'file_mdm_exif',
    'file_mdm_font',
  ]);
}

/**
 * Clear caches to discover new effects.
 */
function image_effects_update_8202() {

  // Empty function.
}

/**
 * Clear caches to discover new effects.
 */
function image_effects_update_8203() {

  // Empty function.
}

Functions

Namesort descending Description
image_effects_requirements Implements hook_requirements().
image_effects_update_8201 Enable file_mdm module and required submodules.
image_effects_update_8202 Clear caches to discover new effects.
image_effects_update_8203 Clear caches to discover new effects.
image_effects_update_last_removed Minimum 1.x schema version to allow upgrading from.