-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmemcacheshim.functions.php
126 lines (87 loc) · 2.83 KB
/
memcacheshim.functions.php
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
function memcache_add(MemcacheShim $obj, $key, $var, $flags = 0, $expire = 0)
{
return $obj->add($key, $var, $flags, $expire);
}
function memcache_add_server(MemcacheShim $obj,
$host,
$port = 11211,
$persistent = false,
$weight = 0,
$timeout = 0,
$retry_interval = 0,
$status = true,
$failure_callback = false,
$timeoutms = 0)
{
return $obj->addServer($host, $port, $persistent, $weight, $timeout, $retry_interval, $status, $failure_callback, $timeoutms);
}
function memcache_close(MemcacheShim $obj)
{
return $obj->close();
}
function memcache_connect($host, $port = 11211, $timeout = 0)
{
$obj = new MemcacheShim();
$obj->connect($host, $port);
return $obj;
}
function memcache_decrement(MemcacheShim $obj, $key, $value)
{
return $obj->decrement($key, $value);
}
function memcache_delete(MemcacheShim $obj, $key)
{
return $obj->delete($key);
}
function memcache_flush(MemcacheShim $obj)
{
return $obj->flush();
}
function memcache_get(MemcacheShim $obj, $key, $flags = 0)
{
return $obj->get($key);
}
function memcache_get_server_status(MemcacheShim $obj, $host, $port = 11211)
{
return $obj->getServerStatus($host, $port);
}
function memcache_get_version(MemcacheShim $obj)
{
return $obj->getVersion();
}
function memcache_increment(MemcacheShim $obj, $key, $value)
{
return $obj->increment($key, $value);
}
function memcache_pconnect($host, $port = 11211, $timeout = 0)
{
$obj = new MemcacheShim();
$obj->pconnect($host, $port);
return $obj;
}
function memcache_replace(MemcacheShim $obj, $key, $flags = 0, $expire = 0)
{
return $obj->replace($key, $flags, $expire);
}
function memcache_set(MemcacheShim $obj, $key, $flags = 0, $expire = 0)
{
return $obj->set($key, $flags, $expire);
}
function memcache_set_compress_threshold(MemcacheShim $obj, $threshold, $min_savings = 0)
{
return $obj->setCompressThreshold($threshold, $min_savings);
}
function memcache_set_server_params(MemcacheShim $obj,
$host,
$port = 11211,
$persistent = false,
$weight = 0,
$timeout = 0,
$retry_interval = 0,
$status = true,
$failure_callback = false,
$timeoutms = 0)
{
return $obj->setServerParams($host, $port, $persistent, $weight, $timeout, $retry_interval, $status, $failure_callback, $timeoutms);
}