-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindowslive.install
More file actions
57 lines (51 loc) · 1.81 KB
/
windowslive.install
File metadata and controls
57 lines (51 loc) · 1.81 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* This WindowsLiveID module install file implement the requirements check
* and hook for uninstall.
*
* @version $Id: windowslive.install $
* @copyright Copyright (c) 2010 Schakra, Inc. All Rights Reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @package Drupal
* @subpackage WindowsLiveID
* @since 1.0
*/
//Windows LIVE SDK needs 5.X
define('WINDOWSLIVEID_MINIMUM_PHP', '5.0.0');
/**
* Implements of hook_install
*/
function winliveid_install() {
}
/**
* Implements Windows Live ID requirements
*
* Checking the available PHP version.
*/
function windowslive_requirements($phase) {
$requirements = array();
if(!function_exists('version_compare') ) {
$requirements['version_compare'] = array(
'severity' => REQUIREMENT_ERROR,
'description' => t('WindowsLiveID requires PHP5 and above to work. The Windows Live ID SDK that this module depends on is provided by the Windows Live ID service and is only compatible with PHP5.'),
);
} else if (version_compare(WINDOWSLIVEID_MINIMUM_PHP, phpversion()) > 0 ) {
$requirements['version_compare'] = array(
'severity' => REQUIREMENT_ERROR,
'description' => t('WindowsLiveID requires PHP5 and above to work. The Windows Live ID SDK that this module depends on is provided by the Windows Live ID service and is only compatible with PHP5.'),
);
}
return $requirements;
}
/**
* Implements of hook_uninstall
*
* Remove all the vaules in authmap table for module 'WindowsLiveID', during uninstallation.
*/
function windowslive_uninstall() {
db_delete('authmap')
->condition('module', "windowslive")
->execute();
variable_del('windowslive_clientid');
variable_del('windowslive_secretkey');
}