forked from drupalsocialinitiative/social_auth_facebook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
social_auth_facebook.install
44 lines (34 loc) · 1.2 KB
/
social_auth_facebook.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @file
* Install, update, and uninstall functions for the Social Auth Facebook module.
*/
use Drupal\social_api\Utility\SocialApiImplementerInstaller;
use Drupal\social_auth\Controller\SocialAuthController;
/**
* Implements hook_requirements().
*
* Checks that a compatible version of Facebook Graph SDK has been installed
* with Composer. Check installation instructions from the README.txt.
*/
function social_auth_facebook_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_facebook', 'Social Auth Facebook', 'facebook/graph-sdk', 5.0, 6.0);
}
return $requirements;
}
/**
* Implements hook_install().
*/
function social_auth_facebook_install() {
SocialAuthController::setLoginButtonSettings('social_auth_facebook', 'social_auth_facebook.redirect_to_fb', 'img/facebook_logo.svg');
}
/**
* Implements hook_uninstall().
*/
function social_auth_facebook_uninstall() {
SocialAuthController::deleteLoginButtonSettings('social_auth_facebook');
}