You are here

automatic_updates.install in Automatic Updates 8.2

Same filename and directory in other branches
  1. 8 automatic_updates.install
  2. 7 automatic_updates.install

Contains install and update functions for Automatic Updates.

File

automatic_updates.install
View source
<?php

/**
 * @file
 * Contains install and update functions for Automatic Updates.
 */
use Drupal\automatic_updates\Validation\ReadinessRequirements;

/**
 * Implements hook_requirements().
 */
function automatic_updates_requirements($phase) {
  if ($phase === 'runtime') {

    /** @var \Drupal\automatic_updates\Validation\ReadinessRequirements $readiness_requirement */
    $readiness_requirement = \Drupal::classResolver(ReadinessRequirements::class);
    return $readiness_requirement
      ->getRequirements();
  }
  if ($phase === 'install' && !class_exists('PhpTuf\\ComposerStager\\Domain\\Beginner')) {
    return [
      'automatic_updates' => [
        'description' => t('External dependencies for Automatic Updates are not available. Composer must be used to download the module with dependencies.'),
        'severity' => REQUIREMENT_ERROR,
      ],
    ];
  }
}

Functions