forked from DBCDK/ding_user
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ding_user.install
47 lines (41 loc) · 1.08 KB
/
ding_user.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
45
46
47
<?php
/**
* @file
* Install new cache table to store user credentials.
*/
/**
* Implements hook_install().
*/
function ding_user_install() {
// Use DingUserCredentialsCache instead of default DrupalDatabaseCache.
variable_set('cache_class_cache_ding_user_credentials', 'DingUserCredentialsCache');
}
/**
* Implements hook_schema().
*/
function ding_user_schema() {
$schema['cache_ding_user_credentials'] = drupal_get_schema_unprocessed('system', 'cache');
return $schema;
}
/**
* Create table for credential caching.
*/
function ding_user_update_7000(&$sandbox) {
$res = drupal_install_schema('ding_user');
return $res;
}
/**
* Use DingUserCredentialsCache instead of default DrupalDatabaseCache.
*/
function ding_user_update_7001(&$sandbox) {
variable_set('cache_class_cache_ding_user_credentials', 'DingUserCredentialsCache');
}
/**
* Set weight of ding_user to -1 to ensure it is called first
*/
function ding_user_update_7002(&$sandbox) {
$updated = db_update('system')
->fields(array('weight' => -1))
->condition('name', 'ding_user', '=')
->execute();
}