You are here

trailing_slash.install in Trailing Slash 8

Same filename and directory in other branches
  1. 7 trailing_slash.install

File

trailing_slash.install
View source
<?php

include_once 'trailing_slash.module';

/**
 * Implements hook_install().
 */
function trailing_slash_install() {

  // To be executed after ServiceProvider.
  module_set_weight('trailing_slash', 1);
}

/**
 * Implements hook_requirements().
 */
function trailing_slash_requirements($phase) {
  $requirements = [];
  $requirements['php'] = [
    'title' => t('PHP'),
    'value' => TRAILING_SLASH_MINIMUM_PHP,
  ];
  if (version_compare(phpversion(), TRAILING_SLASH_MINIMUM_PHP) < 0) {
    $requirements['php']['description'] = t('Your PHP installation is too old. This module requires at least PHP %version.', [
      '%version' => TRAILING_SLASH_MINIMUM_PHP,
    ]);
    $requirements['php']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}

Functions