social_auth_google.install in Social Auth Google 8
Same filename and directory in other branches
Install and uninstall functions for the Google Login module.
File
social_auth_google.installView source
<?php
/**
* @file
* Install and uninstall functions for the Google Login module.
*/
use Drupal\social_api\Utility\SocialApiImplementerInstaller;
use Drupal\social_auth\Controller\SocialAuthController;
/**
* Implements hook_requirements().
*/
function social_auth_google_requirements($phase) {
$requirements = [];
// Social API should be installed at this point in order to check library.
\Drupal::service('module_installer')
->install([
'social_api',
]);
if ($phase == 'install') {
$requirements = SocialApiImplementerInstaller::checkLibrary('social_auth_google', 'Social Auth Google', 'google/apiclient', 2.0, 3.0);
}
return $requirements;
}
/**
* Implements hook_install().
*/
function social_auth_google_install() {
SocialAuthController::setLoginButtonSettings('social_auth_google', 'social_auth_google.redirect_to_google', 'img/google_logo.svg');
}
/**
* Implements hook_uninstall().
*/
function social_auth_google_uninstall() {
SocialAuthController::deleteLoginButtonSettings('social_auth_google');
}
Functions
Name | Description |
---|---|
social_auth_google_install | Implements hook_install(). |
social_auth_google_requirements | Implements hook_requirements(). |
social_auth_google_uninstall | Implements hook_uninstall(). |