You are here

oauth2_server.install in OAuth2 Server 8

Same filename and directory in other branches
  1. 7 oauth2_server.install
  2. 2.0.x oauth2_server.install

The Oauth2 Server module.

File

oauth2_server.install
View source
<?php

/**
 * @file
 * The Oauth2 Server module.
 */

/**
 * Implements hook_requirements().
 */
function oauth2_server_requirements($phase) {
  $ret = [];
  if ($phase == 'runtime') {
    $found = class_exists('OAuth2\\Server');
    $description = \Drupal::translation()
      ->translate('The OAuth2 server library is required for the OAuth2 module to function. Download the library using composer, download it from <a href="https://github.com/bshaffer/oauth2-server-php">GitHub</a> or use composer manager.');
    $ret['oauth2'] = [
      'title' => \Drupal::translation()
        ->translate('OAuth2 server library'),
      'value' => $found ? \Drupal::translation()
        ->translate('Available') : \Drupal::translation()
        ->translate('Unavailable'),
      'description' => !$found ? $description : NULL,
      'severity' => $found ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    ];
  }
  return $ret;
}

Functions