Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 281 lines (151 sloc) 5.053 kB
79db1e4 First import
Andrei Zmievski authored
1 <?php
2
3 /**
cf48ff8 Misc
Andrei Zmievski authored
4 * Memcached class.
79db1e4 First import
Andrei Zmievski authored
5 */
6
7 class Memcached {
8cad643 Add --enable-memcached-get-nulls to configure.
Teddy Grenman authored
8 /**
79db1e4 First import
Andrei Zmievski authored
9 * Libmemcached behavior options.
10 */
11
12 const OPT_HASH;
13
14 const OPT_HASH_DEFAULT;
15
90a5020 @tricky Update api docs.
tricky authored
16 const HASH_MD5;
79db1e4 First import
Andrei Zmievski authored
17
90a5020 @tricky Update api docs.
tricky authored
18 const HASH_CRC;
79db1e4 First import
Andrei Zmievski authored
19
90a5020 @tricky Update api docs.
tricky authored
20 const HASH_FNV1_64;
79db1e4 First import
Andrei Zmievski authored
21
90a5020 @tricky Update api docs.
tricky authored
22 const HASH_FNV1A_64;
79db1e4 First import
Andrei Zmievski authored
23
90a5020 @tricky Update api docs.
tricky authored
24 const HASH_FNV1_32;
79db1e4 First import
Andrei Zmievski authored
25
90a5020 @tricky Update api docs.
tricky authored
26 const HASH_FNV1A_32;
79db1e4 First import
Andrei Zmievski authored
27
90a5020 @tricky Update api docs.
tricky authored
28 const HASH_HSIEH;
79db1e4 First import
Andrei Zmievski authored
29
90a5020 @tricky Update api docs.
tricky authored
30 const HASH_MURMUR;
79db1e4 First import
Andrei Zmievski authored
31
32 const OPT_DISTRIBUTION;
33
90a5020 @tricky Update api docs.
tricky authored
34 const DISTRIBUTION_MODULA;
79db1e4 First import
Andrei Zmievski authored
35
90a5020 @tricky Update api docs.
tricky authored
36 const DISTRIBUTION_CONSISTENT;
79db1e4 First import
Andrei Zmievski authored
37
90a5020 @tricky Update api docs.
tricky authored
38 const LIBKETAMA_COMPATIBLE;
b9788ef Implement addServers() method.
andrei authored
39
40 const OPT_BUFFER_REQUESTS;
79db1e4 First import
Andrei Zmievski authored
41
42 const OPT_BINARY_PROTOCOL;
43
44 const OPT_NO_BLOCK;
45
46 const OPT_TCP_NODELAY;
47
48 const OPT_SOCKET_SEND_SIZE;
49
50 const OPT_SOCKET_RECV_SIZE;
51
52 const OPT_CONNECT_TIMEOUT;
53
54 const OPT_RETRY_TIMEOUT;
55
56 const OPT_SND_TIMEOUT;
57
58 const OPT_RCV_TIMEOUT;
59
60 const OPT_POLL_TIMEOUT;
61
db23d6e Register constants.
Andrei Zmievski authored
62 const OPT_SERVER_FAILURE_LIMIT;
63
64 const OPT_CACHE_LOOKUPS;
65
90a5020 @tricky Update api docs.
tricky authored
66 const OPT_AUTO_EJECT_HOSTS;
67
68 const OPT_NUMBER_OF_REPLICAS;
69
70 const OPT_NOREPLY;
71
72 const OPT_VERIFY_KEY;
19a7c42 added missing constant
Mikko Koppanen authored
73
74 const OPT_RANDOMIZE_REPLICA_READS;
90a5020 @tricky Update api docs.
tricky authored
75
76
77 /**
78 * Class parameters
79 */
80 const HAVE_JSON;
81
82 const HAVE_IGBINARY;
79db1e4 First import
Andrei Zmievski authored
83
84 /**
85 * Class options.
86 */
87 const OPT_COMPRESSION;
88
90a5020 @tricky Update api docs.
tricky authored
89 const OPT_COMPRESSION_TYPE;
90
79db1e4 First import
Andrei Zmievski authored
91 const OPT_PREFIX_KEY;
92
90a5020 @tricky Update api docs.
tricky authored
93 /**
94 * Serializer constants
95 */
96 const SERIALIZER_PHP;
97
98 const SERIALIZER_IGBINARY;
99
100 const SERIALIZER_JSON;
101
102 const SERIALIZER_JSON_ARRAY;
103
104 /**
105 * Compression types
106 */
107 const COMPRESSION_TYPE_FASTLZ;
108
109 const COMPRESSION_TYPE_ZLIB;
110
111 /**
112 * Flags
113 */
114 const GET_PRESERVE_ORDER;
115
116 /**
117 * Return values
118 */
119 const GET_ERROR_RETURN_VALUE;
120
121 const RES_PAYLOAD_FAILURE;
122
123 const RES_SUCCESS;
124
125 const RES_FAILURE;
126
127 const RES_HOST_LOOKUP_FAILURE;
128
129 const RES_UNKNOWN_READ_FAILURE;
130
131 const RES_PROTOCOL_ERROR;
132
133 const RES_CLIENT_ERROR;
134
135 const RES_SERVER_ERROR;
136
137 const RES_WRITE_FAILURE;
138
139 const RES_DATA_EXISTS;
140
141 const RES_NOTSTORED;
142
143 const RES_NOTFOUND;
144
145 const RES_PARTIAL_READ;
146
147 const RES_SOME_ERRORS;
148
149 const RES_NO_SERVERS;
150
151 const RES_END;
152
153 const RES_ERRNO;
154
155 const RES_BUFFERED;
156
157 const RES_TIMEOUT;
158
159 const RES_BAD_KEY_PROVIDED;
160
161 const RES_STORED;
162
163 const RES_DELETED;
164
165 const RES_STAT;
166
167 const RES_ITEM;
168
169 const RES_NOT_SUPPORTED;
170
171 const RES_FETCH_NOTFINISHED;
172
173 const RES_SERVER_MARKED_DEAD;
174
175 const RES_UNKNOWN_STAT_KEY;
176
177 const RES_INVALID_HOST_PROTOCOL;
178
179 const RES_MEMORY_ALLOCATION_FAILURE;
180
181 const RES_CONNECTION_SOCKET_CREATE_FAILURE;
182
79db1e4 First import
Andrei Zmievski authored
183
73e30fe Added callback when a new object is created. This eases up adding ser…
Mikko Koppanen authored
184 public function __construct( $persistent_id = '', $on_new_object_cb = null ) {}
79db1e4 First import
Andrei Zmievski authored
185
b57ea9d Merge a number of patches.
Andrei Zmievski authored
186 public function get( $key, $cache_cb = null, &$cas_token = null ) {}
79db1e4 First import
Andrei Zmievski authored
187
b57ea9d Merge a number of patches.
Andrei Zmievski authored
188 public function getByKey( $server_key, $key, $cache_cb = null, &$cas_token = null ) {}
79db1e4 First import
Andrei Zmievski authored
189
19001d0 Implement "preserve order" option for multi-gets.
Andrei Zmievski authored
190 public function getMulti( array $keys, &$cas_tokens = null, $flags = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
191
19001d0 Implement "preserve order" option for multi-gets.
Andrei Zmievski authored
192 public function getMultiByKey( $server_key, array $keys, &$cas_tokens = null, $flags = 0 ) {}
62c49b2 More refactoring and addin arginfo.
Andrei Zmievski authored
193
efa8480 Cannot have cache callback for multigets.
Andrei Zmievski authored
194 public function getDelayed( array $keys, $with_cas = null, $value_cb = null ) {}
62c49b2 More refactoring and addin arginfo.
Andrei Zmievski authored
195
efa8480 Cannot have cache callback for multigets.
Andrei Zmievski authored
196 public function getDelayedByKey( $server_key, array $keys, $with_cas = null, $value_cb = null ) {}
79db1e4 First import
Andrei Zmievski authored
197
198 public function fetch( ) {}
199
200 public function fetchAll( ) {}
201
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
202 public function set( $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
203
494f2c1 @janl Added support for TOUCH.
janl authored
204 public function touch( $key, $expiration = 0 ) {}
205
206 public function touchbyKey( $key, $expiration = 0 ) {}
207
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
208 public function setByKey( $server_key, $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
209
79100de Various fixes.
andrei authored
210 public function setMulti( array $items, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
211
79100de Various fixes.
andrei authored
212 public function setMultiByKey( $server_key, array $items, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
213
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
214 public function cas( $token, $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
215
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
216 public function casByKey( $token, $server_key, $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
217
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
218 public function add( $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
219
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
220 public function addByKey( $server_key, $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
221
90a5020 @tricky Update api docs.
tricky authored
222 public function append( $key, $value ) {}
79db1e4 First import
Andrei Zmievski authored
223
90a5020 @tricky Update api docs.
tricky authored
224 public function appendByKey( $server_key, $key, $value ) {}
79db1e4 First import
Andrei Zmievski authored
225
90a5020 @tricky Update api docs.
tricky authored
226 public function prepend( $key, $value ) {}
79db1e4 First import
Andrei Zmievski authored
227
90a5020 @tricky Update api docs.
tricky authored
228 public function prependByKey( $server_key, $key, $value ) {}
79db1e4 First import
Andrei Zmievski authored
229
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
230 public function replace( $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
231
90a5020 @tricky Update api docs.
tricky authored
232 public function replaceByKey( $server_key, $key, $value, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
233
79100de Various fixes.
andrei authored
234 public function delete( $key, $time = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
235
90a5020 @tricky Update api docs.
tricky authored
236 public function deleteByKey( $server_key, $key, $time = 0 ) {}
237
238 public function deleteMulti( array $keys, $expiration = 0 ) {}
239
240 public function deleteMultiByKey( $server_key, array $keys, $expiration = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
241
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
242 public function increment( $key, $offset = 1) {}
79db1e4 First import
Andrei Zmievski authored
243
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
244 public function decrement( $key, $offset = 1) {}
79db1e4 First import
Andrei Zmievski authored
245
246 public function getOption( $option ) {}
247
248 public function setOption( $option, $value ) {}
249
90a5020 @tricky Update api docs.
tricky authored
250 public function setOptions( array $options ) {}
251
b9788ef Implement addServers() method.
andrei authored
252 public function addServer( $host, $port, $weight = 0 ) {}
253
254 public function addServers( array $servers ) {}
79db1e4 First import
Andrei Zmievski authored
255
93f1bc7 Clean up API.
Andrei Zmievski authored
256 public function getServerList( ) {}
79db1e4 First import
Andrei Zmievski authored
257
93f1bc7 Clean up API.
Andrei Zmievski authored
258 public function getServerByKey( $server_key ) {}
79db1e4 First import
Andrei Zmievski authored
259
79100de Various fixes.
andrei authored
260 public function flush( $delay = 0 ) {}
c13a7df Forgot getStats().
Andrei Zmievski authored
261
262 public function getStats( ) {}
93f1bc7 Clean up API.
Andrei Zmievski authored
263
90a5020 @tricky Update api docs.
tricky authored
264 public function getVersion( ) {}
265
93f1bc7 Clean up API.
Andrei Zmievski authored
266 public function getResultCode( ) {}
d4fd981 Implement get() and getBykey().
Andrei Zmievski authored
267
7ca7a87 Release 1.0.0.
Andrei Zmievski authored
268 public function getResultMessage( ) {}
269
682de86 Add isPersistent method.
Teddy Grenman authored
270 public function isPersistent( ) {}
271
85ba512 Add isPristine method.
Teddy Grenman authored
272 public function isPristine( ) {}
273
79db1e4 First import
Andrei Zmievski authored
274 }
275
276 class MemcachedException extends Exception {
277
4652de7 Fix unsetting of prefix key option.
Andrei Zmievski authored
278 function __construct( $errmsg = "", $errcode = 0 ) {}
79db1e4 First import
Andrei Zmievski authored
279
280 }
Something went wrong with that request. Please try again.