You are here

social_auth_google.install in Social Auth Google 3.x

Same filename and directory in other branches
  1. 8.2 social_auth_google.install
  2. 8 social_auth_google.install

Install, update, and uninstall functions for the Social Auth Google module.

File

social_auth_google.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Social Auth Google module.
 */
use Drupal\social_auth\Controller\SocialAuthController;

/**
 * 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');
}

/**
 * Implements hook_update_N().
 *
 * The key api_calls was changed to endpoints. This update copies the values
 * in 'api_calls' to 'endpoints'.
 */
function social_auth_google_update_8201(&$sandbox) {
  $config = \Drupal::configFactory()
    ->getEditable('social_auth_google.settings');
  $endpoints = $config
    ->get('api_calls');
  $config
    ->set('endpoints', $endpoints)
    ->save();
}