-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcache.install
98 lines (95 loc) · 2.65 KB
/
lcache.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
94
95
96
97
98
<?php
/**
* Implements hook_requirements().
*/
function lcache_requirements($phase) {
// @TODO: Version check for APCu.
// @TODO: Check for a sane apcu_sma_info() configuration here.
}
/**
* Implements hook_schema().
*/
function lcache_schema() {
$schema['lcache_events'] = array(
'description' => 'Stores a stream of cache changes for coherency management.',
'fields' => array(
'event_id' => array(
'description' => 'Primary Key: Event ID.',
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
),
'pool' => array(
'description' => 'PHP process pool that wrote the change.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'binary' => TRUE,
'default' => '',
),
'address' => array(
'description' => 'Cache entry address (bin and key).',
'type' => 'varchar',
'length' => 512,
'not null' => FALSE,
'binary' => TRUE,
'default' => NULL,
),
'value' => array(
'description' => 'Cache entry value.',
'type' => 'blob',
'not null' => FALSE,
'binary' => TRUE,
'size' => 'big',
),
'expiration' => array(
'description' => 'A Unix timestamp indicating when the cache entry should expire, or NULL for never.',
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
),
'created' => array(
'description' => 'A Unix timestamp indicating when the cache entry was created.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'expiration' => array('expiration'),
'lookup_miss' => array('address', 'event_id'),
),
'primary key' => array('event_id'),
);
$schema['lcache_tags'] = array(
'description' => 'Stores mappings from tags to cache items.',
'fields' => array(
'tag' => array(
'description' => 'Cache tag.',
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
'binary' => TRUE,
'default' => NULL,
),
'event_id' => array(
'description' => 'The event_id associated with the cache entry.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'rewritten_entry' => array('event_id'),
),
'primary key' => array('tag', 'event_id'),
'foreign keys' => array(
'lcache_events_event_id' => array(
'table' => 'lcache_events',
'columns' => array('event_id' => 'event_id'),
),
),
);
return $schema;
}