You are here

function upgrade_status_requirements in Upgrade Status 8.3

Same name and namespace in other branches
  1. 8.2 upgrade_status.install \upgrade_status_requirements()

Implements hook_requirements().

File

./upgrade_status.install, line 11
Install, update, and uninstall functions for the Upgrade Status module.

Code

function upgrade_status_requirements($phase) {
  if ($phase == 'install') {

    // Check if the Drupal Finder is available. This will attempt to autoload
    // the class, so we can bail out as soon as possible.
    if (!class_exists('DrupalFinder\\DrupalFinder')) {
      return [
        'upgrade_status' => [
          'description' => t('External dependencies for Upgrade Status are not available. Composer must be used to download the module with dependencies. See <a href="@url">the Upgrade Status project page</a> for instructions.', [
            '@url' => 'https://drupal.org/project/upgrade_status',
          ]),
          'severity' => REQUIREMENT_ERROR,
        ],
      ];
    }
  }
  return [];
}