1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
// Start of memcache v.3.0.8 |
4
|
|
|
|
5
|
|
|
class MemcachePool { |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
9
|
|
|
* Open memcached server connection |
10
|
|
|
* @link https://php.net/manual/en/memcache.connect.php |
11
|
|
|
* @param string $host <p> |
12
|
|
|
* Point to the host where memcached is listening for connections. This parameter |
13
|
|
|
* may also specify other transports like <em>unix:///path/to/memcached.sock</em> |
14
|
|
|
* to use UNIX domain sockets, in this case <b>port</b> must also |
15
|
|
|
* be set to <em>0</em>. |
16
|
|
|
* </p> |
17
|
|
|
* @param int $port [optional] <p> |
18
|
|
|
* Point to the port where memcached is listening for connections. Set this |
19
|
|
|
* parameter to <em>0</em> when using UNIX domain sockets. |
20
|
|
|
* </p> |
21
|
|
|
* <p> |
22
|
|
|
* Please note: <b>port</b> defaults to |
23
|
|
|
* {@link https://php.net/manual/ru/memcache.ini.php#ini.memcache.default-port memcache.default_port} |
24
|
|
|
* if not specified. For this reason it is wise to specify the port |
25
|
|
|
* explicitly in this method call. |
26
|
|
|
* </p> |
27
|
|
|
* @param int $timeout [optional] <p>Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow.</p> |
28
|
|
|
* @return boolean <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
29
|
|
|
*/ |
30
|
|
|
public function connect ($host, $port, $timeout = 1) {} |
|
|
|
|
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* (PECL memcache >= 2.0.0)<br/> |
34
|
|
|
* Add a memcached server to connection pool |
35
|
|
|
* @link https://php.net/manual/en/memcache.addserver.php |
36
|
|
|
* @param string $host <p> |
37
|
|
|
* Point to the host where memcached is listening for connections. This parameter |
38
|
|
|
* may also specify other transports like unix:///path/to/memcached.sock |
39
|
|
|
* to use UNIX domain sockets, in this case <i>port</i> must also |
40
|
|
|
* be set to 0. |
41
|
|
|
* </p> |
42
|
|
|
* @param int $port [optional] <p> |
43
|
|
|
* Point to the port where memcached is listening for connections. |
44
|
|
|
* Set this |
45
|
|
|
* parameter to 0 when using UNIX domain sockets. |
46
|
|
|
* </p> |
47
|
|
|
* <p> |
48
|
|
|
* Please note: <i>port</i> defaults to |
49
|
|
|
* memcache.default_port |
50
|
|
|
* if not specified. For this reason it is wise to specify the port |
51
|
|
|
* explicitly in this method call. |
52
|
|
|
* </p> |
53
|
|
|
* @param bool $persistent [optional] <p> |
54
|
|
|
* Controls the use of a persistent connection. Default to <b>TRUE</b>. |
55
|
|
|
* </p> |
56
|
|
|
* @param int $weight [optional] <p> |
57
|
|
|
* Number of buckets to create for this server which in turn control its |
58
|
|
|
* probability of it being selected. The probability is relative to the |
59
|
|
|
* total weight of all servers. |
60
|
|
|
* </p> |
61
|
|
|
* @param int $timeout [optional] <p> |
62
|
|
|
* Value in seconds which will be used for connecting to the daemon. Think |
63
|
|
|
* twice before changing the default value of 1 second - you can lose all |
64
|
|
|
* the advantages of caching if your connection is too slow. |
65
|
|
|
* </p> |
66
|
|
|
* @param int $retry_interval [optional] <p> |
67
|
|
|
* Controls how often a failed server will be retried, the default value |
68
|
|
|
* is 15 seconds. Setting this parameter to -1 disables automatic retry. |
69
|
|
|
* Neither this nor the <i>persistent</i> parameter has any |
70
|
|
|
* effect when the extension is loaded dynamically via <b>dl</b>. |
71
|
|
|
* </p> |
72
|
|
|
* <p> |
73
|
|
|
* Each failed connection struct has its own timeout and before it has expired |
74
|
|
|
* the struct will be skipped when selecting backends to serve a request. Once |
75
|
|
|
* expired the connection will be successfully reconnected or marked as failed |
76
|
|
|
* for another <i>retry_interval</i> seconds. The typical |
77
|
|
|
* effect is that each web server child will retry the connection about every |
78
|
|
|
* <i>retry_interval</i> seconds when serving a page. |
79
|
|
|
* </p> |
80
|
|
|
* @param bool $status [optional] <p> |
81
|
|
|
* Controls if the server should be flagged as online. Setting this parameter |
82
|
|
|
* to <b>FALSE</b> and <i>retry_interval</i> to -1 allows a failed |
83
|
|
|
* server to be kept in the pool so as not to affect the key distribution |
84
|
|
|
* algorithm. Requests for this server will then failover or fail immediately |
85
|
|
|
* depending on the <i>memcache.allow_failover</i> setting. |
86
|
|
|
* Default to <b>TRUE</b>, meaning the server should be considered online. |
87
|
|
|
* </p> |
88
|
|
|
* @param callable $failure_callback [optional] <p> |
89
|
|
|
* Allows the user to specify a callback function to run upon encountering an |
90
|
|
|
* error. The callback is run before failover is attempted. The function takes |
91
|
|
|
* two parameters, the hostname and port of the failed server. |
92
|
|
|
* </p> |
93
|
|
|
* @param int $timeoutms [optional] <p> |
94
|
|
|
* </p> |
95
|
|
|
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
96
|
|
|
*/ |
97
|
|
|
public function addServer ($host, $port = 11211, $persistent = true, $weight = null, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null, $timeoutms = null) {} |
|
|
|
|
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* (PECL memcache >= 2.1.0)<br/> |
101
|
|
|
* Changes server parameters and status at runtime |
102
|
|
|
* @link https://secure.php.net/manual/en/memcache.setserverparams.php |
103
|
|
|
* @param string $host <p>Point to the host where memcached is listening for connections.</p. |
104
|
|
|
* @param int $port [optional] <p> |
105
|
|
|
* Point to the port where memcached is listening for connections. |
106
|
|
|
* </p> |
107
|
|
|
* @param int $timeout [optional] <p> |
108
|
|
|
* Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow. |
109
|
|
|
* </p> |
110
|
|
|
* @param int $retry_interval [optional] <p> |
111
|
|
|
* Controls how often a failed server will be retried, the default value |
112
|
|
|
* is 15 seconds. Setting this parameter to -1 disables automatic retry. |
113
|
|
|
* Neither this nor the <b>persistent</b> parameter has any |
114
|
|
|
* effect when the extension is loaded dynamically via {@link https://secure.php.net/manual/en/function.dl.php dl()}. |
115
|
|
|
* </p> |
116
|
|
|
* @param bool $status [optional] <p> |
117
|
|
|
* Controls if the server should be flagged as online. Setting this parameter |
118
|
|
|
* to <b>FALSE</b> and <b>retry_interval</b> to -1 allows a failed |
119
|
|
|
* server to be kept in the pool so as not to affect the key distribution |
120
|
|
|
* algorithm. Requests for this server will then failover or fail immediately |
121
|
|
|
* depending on the <b>memcache.allow_failover</b> setting. |
122
|
|
|
* Default to <b>TRUE</b>, meaning the server should be considered online. |
123
|
|
|
* </p> |
124
|
|
|
* @param callable $failure_callback [optional] <p> |
125
|
|
|
* Allows the user to specify a callback function to run upon encountering an error. The callback is run before failover is attempted. |
126
|
|
|
* The function takes two parameters, the hostname and port of the failed server. |
127
|
|
|
* </p> |
128
|
|
|
* @return boolean <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
129
|
|
|
*/ |
130
|
|
|
public function setServerParams ($host, $port = 11211, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null) {} |
|
|
|
|
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* |
134
|
|
|
*/ |
135
|
|
|
public function setFailureCallback () {} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* (PECL memcache >= 2.1.0)<br/> |
139
|
|
|
* Returns server status |
140
|
|
|
* @link https://php.net/manual/en/memcache.getserverstatus.php |
141
|
|
|
* @param string $host Point to the host where memcached is listening for connections. |
142
|
|
|
* @param int $port Point to the port where memcached is listening for connections. |
143
|
|
|
* @return int Returns a the servers status. 0 if server is failed, non-zero otherwise |
144
|
|
|
*/ |
145
|
|
|
public function getServerStatus ($host, $port = 11211) {} |
|
|
|
|
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* |
149
|
|
|
*/ |
150
|
|
|
public function findServer () {} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
154
|
|
|
* Return version of the server |
155
|
|
|
* @link https://php.net/manual/en/memcache.getversion.php |
156
|
|
|
* @return string|boolean Returns a string of server version number or <b>FALSE</b> on failure. |
157
|
|
|
*/ |
158
|
|
|
public function getVersion () {} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* (PECL memcache >= 2.0.0)<br/> |
162
|
|
|
* Add an item to the server. If the key already exists, the value will not be added and <b>FALSE</b> will be returned. |
163
|
|
|
* @link https://php.net/manual/en/memcache.add.php |
164
|
|
|
* @param string $key The key that will be associated with the item. |
165
|
|
|
* @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
166
|
|
|
* @param int $flag [optional] <p> |
167
|
|
|
* Use <b>MEMCACHE_COMPRESSED</b> to store the item |
168
|
|
|
* compressed (uses zlib). |
169
|
|
|
* </p> |
170
|
|
|
* @param int $expire [optional] <p>Expiration time of the item. |
171
|
|
|
* If it's equal to zero, the item will never expire. |
172
|
|
|
* You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
173
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. Returns <b>FALSE</b> if such key already exist. For the rest Memcache::add() behaves similarly to Memcache::set(). |
174
|
|
|
*/ |
175
|
|
|
public function add ($key , $var, $flag = null, $expire = null) {} |
|
|
|
|
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
179
|
|
|
* Stores an item var with key on the memcached server. Parameter expire is expiration time in seconds. |
180
|
|
|
* If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, |
181
|
|
|
* it could be deleted from the cache to make place for other items). |
182
|
|
|
* You can use MEMCACHE_COMPRESSED constant as flag value if you want to use on-the-fly compression (uses zlib). |
183
|
|
|
* @link https://php.net/manual/en/memcache.set.php |
184
|
|
|
* @param string $key The key that will be associated with the item. |
185
|
|
|
* @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
186
|
|
|
* @param int $flag [optional] Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib). |
187
|
|
|
* @param int $expire [optional] Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). |
188
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
189
|
|
|
*/ |
190
|
|
|
public function set ($key, $var, $flag = null, $expire = null) {} |
|
|
|
|
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
194
|
|
|
* Replace value of the existing item |
195
|
|
|
* @link https://php.net/manual/en/memcache.replace.php |
196
|
|
|
* @param string $key <p>The key that will be associated with the item.</p> |
197
|
|
|
* @param mixed $var <p>The variable to store. Strings and integers are stored as is, other types are stored serialized.</p> |
198
|
|
|
* @param int $flag [optional] <p>Use <b>MEMCACHE_COMPRESSED</b> to store the item compressed (uses zlib).</p> |
199
|
|
|
* @param int $expire [optional] <p>Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
200
|
|
|
* @return boolean Returns TRUE on success or FALSE on failure. |
201
|
|
|
*/ |
202
|
|
|
public function replace ($key, $var, $flag = null, $expire = null) {} |
|
|
|
|
203
|
|
|
|
204
|
|
|
public function cas () {} |
205
|
|
|
|
206
|
|
|
public function append () {} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return string |
210
|
|
|
*/ |
211
|
|
|
public function prepend () {} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
215
|
|
|
* Retrieve item from the server |
216
|
|
|
* @link https://php.net/manual/en/memcache.get.php |
217
|
|
|
* @param string|array $key <p> |
218
|
|
|
* The key or array of keys to fetch. |
219
|
|
|
* </p> |
220
|
|
|
* @param int|array $flags [optional] <p> |
221
|
|
|
* If present, flags fetched along with the values will be written to this parameter. These |
222
|
|
|
* flags are the same as the ones given to for example {@link https://php.net/manual/en/memcache.set.php Memcache::set()}. |
223
|
|
|
* The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate |
224
|
|
|
* compression and serialization status). |
225
|
|
|
* </p> |
226
|
|
|
* @return string|array <p> |
227
|
|
|
* Returns the string associated with the <b>key</b> or |
228
|
|
|
* an array of found key-value pairs when <b>key</b> is an {@link https://php.net/manual/en/language.types.array.php array}. |
229
|
|
|
* Returns <b>FALSE</b> on failure, <b>key</b> is not found or |
230
|
|
|
* <b>key</b> is an empty {@link https://php.net/manual/en/language.types.array.php array}. |
231
|
|
|
* </p> |
232
|
|
|
*/ |
233
|
|
|
public function get ($key, &$flags = null) {} |
|
|
|
|
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
237
|
|
|
* Delete item from the server |
238
|
|
|
* https://secure.php.net/manual/ru/memcache.delete.php |
239
|
|
|
* @param $key string The key associated with the item to delete. |
240
|
|
|
* @param $timeout int [optional] This deprecated parameter is not supported, and defaults to 0 seconds. Do not use this parameter. |
241
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
242
|
|
|
*/ |
243
|
|
|
public function delete ($key, $timeout = 0 ) {} |
|
|
|
|
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
247
|
|
|
* Get statistics of the server |
248
|
|
|
* @link https://php.net/manual/ru/memcache.getstats.php |
249
|
|
|
* @param string $type [optional] <p> |
250
|
|
|
* The type of statistics to fetch. |
251
|
|
|
* Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. |
252
|
|
|
* According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
253
|
|
|
* @param int $slabid [optional] <p> |
254
|
|
|
* Used in conjunction with <b>type</b> set to |
255
|
|
|
* cachedump to identify the slab to dump from. The cachedump |
256
|
|
|
* command ties up the server and is strictly to be used for |
257
|
|
|
* debugging purposes. |
258
|
|
|
* </p> |
259
|
|
|
* @param int $limit [optional] <p> |
260
|
|
|
* Used in conjunction with <b>type</b> set to cachedump to limit the number of entries to dump. |
261
|
|
|
* </p> |
262
|
|
|
* @return array|bool Returns an associative array of server statistics or <b>FALSE</b> on failure. |
263
|
|
|
*/ |
264
|
|
|
public function getStats ($type = null, $slabid = null, $limit = 100) {} |
|
|
|
|
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* (PECL memcache >= 2.0.0)<br/> |
268
|
|
|
* Get statistics from all servers in pool |
269
|
|
|
* @link https://php.net/manual/en/memcache.getextendedstats.php |
270
|
|
|
* @param string $type [optional] <p>The type of statistics to fetch. Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
271
|
|
|
* @param int $slabid [optional] <p> |
272
|
|
|
* Used in conjunction with <b>type</b> set to |
273
|
|
|
* cachedump to identify the slab to dump from. The cachedump |
274
|
|
|
* command ties up the server and is strictly to be used for |
275
|
|
|
* debugging purposes. |
276
|
|
|
* </p> |
277
|
|
|
* @param int $limit Used in conjunction with type set to cachedump to limit the number of entries to dump. |
278
|
|
|
* @return array|bool Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
279
|
|
|
* Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
280
|
|
|
* on failure. |
281
|
|
|
*/ |
282
|
|
|
public function getExtendedStats ($type = null, $slabid = null, $limit = 100) {} |
|
|
|
|
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* (PECL memcache >= 2.0.0)<br/> |
286
|
|
|
* Enable automatic compression of large values |
287
|
|
|
* @link https://php.net/manual/en/memcache.setcompressthreshold.php |
288
|
|
|
* @param int $thresold <p>Controls the minimum value length before attempting to compress automatically.</p> |
289
|
|
|
* @param float $min_saving [optional] <p>Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.</p> |
290
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
291
|
|
|
*/ |
292
|
|
|
public function setCompressThreshold ($thresold, $min_saving = 0.2) {} |
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
295
|
|
|
* Increment item's value |
296
|
|
|
* @link https://php.net/manual/en/memcache.increment.php |
297
|
|
|
* @param $key string Key of the item to increment. |
298
|
|
|
* @param $value int [optional] increment the item by <b>value</b> |
299
|
|
|
* @return int|boolean Returns new items value on success or <b>FALSE</b> on failure. |
300
|
|
|
*/ |
301
|
|
|
public function increment ($key, $value = 1) {} |
|
|
|
|
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
305
|
|
|
* Decrement item's value |
306
|
|
|
* @link https://php.net/manual/en/memcache.decrement.php |
307
|
|
|
* @param $key string Key of the item do decrement. |
308
|
|
|
* @param $value int Decrement the item by <b>value</b>. |
309
|
|
|
* @return int|boolean Returns item's new value on success or <b>FALSE</b> on failure. |
310
|
|
|
*/ |
311
|
|
|
public function decrement ($key, $value = 1) {} |
|
|
|
|
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* (PECL memcache >= 0.4.0)<br/> |
315
|
|
|
* Close memcached server connection |
316
|
|
|
* @link https://php.net/manual/en/memcache.close.php |
317
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
318
|
|
|
*/ |
319
|
|
|
public function close () {} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* (PECL memcache >= 1.0.0)<br/> |
323
|
|
|
* Flush all existing items at the server |
324
|
|
|
* @link https://php.net/manual/en/memcache.flush.php |
325
|
|
|
* @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
326
|
|
|
*/ |
327
|
|
|
public function flush () {} |
328
|
|
|
|
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
/** |
332
|
|
|
* Represents a connection to a set of memcache servers. |
333
|
|
|
* @link https://php.net/manual/en/class.memcache.php |
334
|
|
|
*/ |
335
|
|
|
class Memcache extends MemcachePool { |
336
|
|
|
|
337
|
|
|
|
338
|
|
|
/** |
339
|
|
|
* (PECL memcache >= 0.4.0)<br/> |
340
|
|
|
* Open memcached server persistent connection |
341
|
|
|
* @link https://php.net/manual/en/memcache.pconnect.php |
342
|
|
|
* @param string $host <p> |
343
|
|
|
* Point to the host where memcached is listening for connections. This parameter |
344
|
|
|
* may also specify other transports like unix:///path/to/memcached.sock |
345
|
|
|
* to use UNIX domain sockets, in this case <i>port</i> must also |
346
|
|
|
* be set to 0. |
347
|
|
|
* </p> |
348
|
|
|
* @param int $port [optional] <p> |
349
|
|
|
* Point to the port where memcached is listening for connections. Set this |
350
|
|
|
* parameter to 0 when using UNIX domain sockets. |
351
|
|
|
* </p> |
352
|
|
|
* @param int $timeout [optional] <p> |
353
|
|
|
* Value in seconds which will be used for connecting to the daemon. Think |
354
|
|
|
* twice before changing the default value of 1 second - you can lose all |
355
|
|
|
* the advantages of caching if your connection is too slow. |
356
|
|
|
* </p> |
357
|
|
|
* @return mixed a Memcache object or <b>FALSE</b> on failure. |
358
|
|
|
*/ |
359
|
|
|
public function pconnect ($host, $port, $timeout = 1) {} |
|
|
|
|
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
// string $host [, int $port [, int $timeout ]] |
363
|
|
|
|
364
|
|
|
/** |
365
|
|
|
* (PECL memcache >= 0.2.0)</br> |
366
|
|
|
* Memcache::connect — Open memcached server connection |
367
|
|
|
* @link https://php.net/manual/en/memcache.connect.php |
368
|
|
|
* @param string $host <p> |
369
|
|
|
* Point to the host where memcached is listening for connections. |
370
|
|
|
* This parameter may also specify other transports like |
371
|
|
|
* unix:///path/to/memcached.sock to use UNIX domain sockets, |
372
|
|
|
* in this case port must also be set to 0. |
373
|
|
|
* </p> |
374
|
|
|
* @param int $port [optional] <p> |
375
|
|
|
* Point to the port where memcached is listening for connections. |
376
|
|
|
* Set this parameter to 0 when using UNIX domain sockets. |
377
|
|
|
* Note: port defaults to memcache.default_port if not specified. |
378
|
|
|
* For this reason it is wise to specify the port explicitly in this method call. |
379
|
|
|
* </p> |
380
|
|
|
* @param int $timeout [optional] <p> |
381
|
|
|
* Value in seconds which will be used for connecting to the daemon. |
382
|
|
|
* </p> |
383
|
|
|
* @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
384
|
|
|
*/ |
385
|
|
|
function memcache_connect ($host, $port, $timeout = 1) {} |
|
|
|
|
386
|
|
|
|
387
|
|
|
/** |
388
|
|
|
* (PECL memcache >= 0.4.0) |
389
|
|
|
* Memcache::pconnect — Open memcached server persistent connection |
390
|
|
|
* |
391
|
|
|
* @link https://php.net/manual/en/memcache.pconnect.php#example-5242 |
392
|
|
|
* @param $host |
393
|
|
|
* @param null $port |
|
|
|
|
394
|
|
|
* @param int $timeout |
395
|
|
|
* @return Memcache |
396
|
|
|
*/ |
397
|
|
|
function memcache_pconnect ($host, $port=null, $timeout=1) {} |
|
|
|
|
398
|
|
|
|
399
|
|
|
function memcache_add_server () {} |
400
|
|
|
|
401
|
|
|
function memcache_set_server_params () {} |
402
|
|
|
|
403
|
|
|
function memcache_set_failure_callback () {} |
404
|
|
|
|
405
|
|
|
function memcache_get_server_status () {} |
406
|
|
|
|
407
|
|
|
function memcache_get_version () {} |
408
|
|
|
|
409
|
|
|
function memcache_add () {} |
410
|
|
|
|
411
|
|
|
function memcache_set () {} |
412
|
|
|
|
413
|
|
|
function memcache_replace () {} |
414
|
|
|
|
415
|
|
|
function memcache_cas () {} |
416
|
|
|
|
417
|
|
|
function memcache_append () {} |
418
|
|
|
|
419
|
|
|
function memcache_prepend () {} |
420
|
|
|
|
421
|
|
|
function memcache_get () {} |
422
|
|
|
|
423
|
|
|
function memcache_delete () {} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* (PECL memcache >= 0.2.0)<br/> |
427
|
|
|
* Turn debug output on/off |
428
|
|
|
* @link https://php.net/manual/en/function.memcache-debug.php |
429
|
|
|
* @param bool $on_off <p> |
430
|
|
|
* Turns debug output on if equals to <b>TRUE</b>. |
431
|
|
|
* Turns debug output off if equals to <b>FALSE</b>. |
432
|
|
|
* </p> |
433
|
|
|
* @return bool <b>TRUE</b> if PHP was built with --enable-debug option, otherwise |
434
|
|
|
* returns <b>FALSE</b>. |
435
|
|
|
*/ |
436
|
|
|
function memcache_debug ($on_off) {} |
|
|
|
|
437
|
|
|
|
438
|
|
|
function memcache_get_stats () {} |
439
|
|
|
|
440
|
|
|
function memcache_get_extended_stats () {} |
441
|
|
|
|
442
|
|
|
function memcache_set_compress_threshold () {} |
443
|
|
|
|
444
|
|
|
function memcache_increment () {} |
445
|
|
|
|
446
|
|
|
function memcache_decrement () {} |
447
|
|
|
|
448
|
|
|
function memcache_close () {} |
449
|
|
|
|
450
|
|
|
function memcache_flush () {} |
451
|
|
|
|
452
|
|
|
define ('MEMCACHE_COMPRESSED', 2); |
453
|
|
|
define ('MEMCACHE_USER1', 65536); |
454
|
|
|
define ('MEMCACHE_USER2', 131072); |
455
|
|
|
define ('MEMCACHE_USER3', 262144); |
456
|
|
|
define ('MEMCACHE_USER4', 524288); |
457
|
|
|
define ('MEMCACHE_HAVE_SESSION', 1); |
458
|
|
|
|
459
|
|
|
// End of memcache v.3.0.8 |
460
|
|
|
?> |
|
|
|
|
461
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.