gauth.install in Google Auth 8
Same filename and directory in other branches
Install and uninstall functions for the Google OAuth module.
File
gauth.installView source
<?php
/**
* @file
* Install and uninstall functions for the Google OAuth module.
*/
/**
* Implements hook_requirements().
*/
function gauth_requirements($phase) {
if ($phase != 'runtime') {
return [];
}
$library_exists = gauth_load_library();
$url = \Drupal\Core\Link::fromTextAndUrl(t('here'), \Drupal\Core\Url::fromUri('https://github.com/google/google-api-php-client/releases'))
->toString();
$documentation = \Drupal\Core\Link::fromTextAndUrl(t('google api php client installation'), \Drupal\Core\Url::fromUri('https://github.com/google/google-api-php-client#installation'))
->toString();
$version = isset($library_exists['versions']) && !empty($library_exists['versions']) ? array_keys($library_exists['versions']) : array(
'2.4.0',
);
return [
'google-api-php-client' => [
'title' => t('Google Api PHP Client'),
'value' => $library_exists ? t('Installed') . ' ' . Google_Client::LIBVER : t('Not installed'),
'description' => $library_exists ? '' : t('Install version "@version" or latest version of the Google api php client library code (from %here) in a libraries directory such as "libraries/google-api-php-client". You can also use composer to install, read more at %documentation. The path should be "libraries/google-api-php-client"', [
'@version' => $version[0],
'%here' => $url,
'%documentation' => $documentation,
]),
'severity' => $library_exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
],
];
}
Functions
Name | Description |
---|---|
gauth_requirements | Implements hook_requirements(). |