forked from RESTful-Drupal/restful
-
Notifications
You must be signed in to change notification settings - Fork 0
/
restful.install
93 lines (81 loc) · 2.35 KB
/
restful.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @file
* Install, update, and uninstall functions for the Restful module.
*/
/**
* Implements hook_schema().
*/
function restful_schema() {
$schema = array();
$schema['cache_restful'] = drupal_get_schema_unprocessed('system', 'cache');
// Rate limit entity base table.
$schema['restful_rate_limit'] = array(
'description' => 'Rate limit base table',
'fields' => array(
'rlid' => array(
'description' => 'The rate limit unique ID.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'event' => array(
'description' => 'The event name.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
),
'identifier' => array(
'description' => 'The user & request identifier.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'timestamp' => array(
'description' => 'The Unix timestamp when the rate limit window started.',
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
),
'expiration' => array(
'description' => 'The Unix timestamp when the rate limit window expires.',
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
),
'hits' => array(
'description' => 'The number of hits.',
'type' => 'int',
'not null' => FALSE,
'default' => 0,
),
),
'unique keys' => array(
'identifier' => array('identifier'),
),
'indexes' => array(
'rate_limit_identifier' => array('identifier'),
),
'primary key' => array('rlid'),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function restful_uninstall() {
variable_del('restful_default_output_formatter');
variable_del('restful_enable_discovery_resource');
variable_del('restful_file_upload');
variable_del('restful_file_upload_allow_anonymous_user');
variable_del('restful_hijack_api_pages');
variable_del('restful_hook_menu_base_path');
variable_del('restful_enable_user_login_resource');
variable_del('restful_global_rate_limit');
variable_del('restful_global_rate_period');
variable_del('restful_enable_users_resource');
variable_del('restful_render_cache');
variable_del('restful_skip_basic_auth');
}