oauth2_server-2.0.x-dev/oauth2_server.install
oauth2_server.install
<?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;
}
