memcached.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257
  1. <?php
  2. // Start of memcached v.2.1.0
  3. /**
  4. * Represents a connection to a set of memcached servers.
  5. * @link http://php.net/manual/en/class.memcached.php
  6. */
  7. class Memcached {
  8. /**
  9. * <p>Enables or disables payload compression. When enabled,
  10. * item values longer than a certain threshold (currently 100 bytes) will be
  11. * compressed during storage and decompressed during retrieval
  12. * transparently.</p>
  13. * <p>Type: boolean, default: <b>TRUE</b>.</p>
  14. * @link http://php.net/manual/en/memcached.constants.php
  15. */
  16. const OPT_COMPRESSION = -1001;
  17. const OPT_COMPRESSION_TYPE = -1004;
  18. /**
  19. * <p>This can be used to create a "domain" for your item keys. The value
  20. * specified here will be prefixed to each of the keys. It cannot be
  21. * longer than 128 characters and will reduce the
  22. * maximum available key size. The prefix is applied only to the item keys,
  23. * not to the server keys.</p>
  24. * <p>Type: string, default: "".</p>
  25. * @link http://php.net/manual/en/memcached.constants.php
  26. */
  27. const OPT_PREFIX_KEY = -1002;
  28. /**
  29. * <p>
  30. * Specifies the serializer to use for serializing non-scalar values.
  31. * The valid serializers are <b>Memcached::SERIALIZER_PHP</b>
  32. * or <b>Memcached::SERIALIZER_IGBINARY</b>. The latter is
  33. * supported only when memcached is configured with
  34. * --enable-memcached-igbinary option and the
  35. * igbinary extension is loaded.
  36. * </p>
  37. * <p>Type: integer, default: <b>Memcached::SERIALIZER_PHP</b>.</p>
  38. * @link http://php.net/manual/en/memcached.constants.php
  39. */
  40. const OPT_SERIALIZER = -1003;
  41. /**
  42. * <p>Indicates whether igbinary serializer support is available.</p>
  43. * <p>Type: boolean.</p>
  44. * @link http://php.net/manual/en/memcached.constants.php
  45. */
  46. const HAVE_IGBINARY = 0;
  47. /**
  48. * <p>Indicates whether JSON serializer support is available.</p>
  49. * <p>Type: boolean.</p>
  50. * @link http://php.net/manual/en/memcached.constants.php
  51. */
  52. const HAVE_JSON = 0;
  53. const HAVE_SESSION = 1;
  54. const HAVE_SASL = 0;
  55. /**
  56. * <p>Specifies the hashing algorithm used for the item keys. The valid
  57. * values are supplied via <b>Memcached::HASH_*</b> constants.
  58. * Each hash algorithm has its advantages and its disadvantages. Go with the
  59. * default if you don't know or don't care.</p>
  60. * <p>Type: integer, default: <b>Memcached::HASH_DEFAULT</b></p>
  61. * @link http://php.net/manual/en/memcached.constants.php
  62. */
  63. const OPT_HASH = 2;
  64. /**
  65. * <p>The default (Jenkins one-at-a-time) item key hashing algorithm.</p>
  66. * @link http://php.net/manual/en/memcached.constants.php
  67. */
  68. const HASH_DEFAULT = 0;
  69. /**
  70. * <p>MD5 item key hashing algorithm.</p>
  71. * @link http://php.net/manual/en/memcached.constants.php
  72. */
  73. const HASH_MD5 = 1;
  74. /**
  75. * <p>CRC item key hashing algorithm.</p>
  76. * @link http://php.net/manual/en/memcached.constants.php
  77. */
  78. const HASH_CRC = 2;
  79. /**
  80. * <p>FNV1_64 item key hashing algorithm.</p>
  81. * @link http://php.net/manual/en/memcached.constants.php
  82. */
  83. const HASH_FNV1_64 = 3;
  84. /**
  85. * <p>FNV1_64A item key hashing algorithm.</p>
  86. * @link http://php.net/manual/en/memcached.constants.php
  87. */
  88. const HASH_FNV1A_64 = 4;
  89. /**
  90. * <p>FNV1_32 item key hashing algorithm.</p>
  91. * @link http://php.net/manual/en/memcached.constants.php
  92. */
  93. const HASH_FNV1_32 = 5;
  94. /**
  95. * <p>FNV1_32A item key hashing algorithm.</p>
  96. * @link http://php.net/manual/en/memcached.constants.php
  97. */
  98. const HASH_FNV1A_32 = 6;
  99. /**
  100. * <p>Hsieh item key hashing algorithm.</p>
  101. * @link http://php.net/manual/en/memcached.constants.php
  102. */
  103. const HASH_HSIEH = 7;
  104. /**
  105. * <p>Murmur item key hashing algorithm.</p>
  106. * @link http://php.net/manual/en/memcached.constants.php
  107. */
  108. const HASH_MURMUR = 8;
  109. /**
  110. * <p>Specifies the method of distributing item keys to the servers.
  111. * Currently supported methods are modulo and consistent hashing. Consistent
  112. * hashing delivers better distribution and allows servers to be added to
  113. * the cluster with minimal cache losses.</p>
  114. * <p>Type: integer, default: <b>Memcached::DISTRIBUTION_MODULA.</b></p>
  115. * @link http://php.net/manual/en/memcached.constants.php
  116. */
  117. const OPT_DISTRIBUTION = 9;
  118. /**
  119. * <p>Modulo-based key distribution algorithm.</p>
  120. * @link http://php.net/manual/en/memcached.constants.php
  121. */
  122. const DISTRIBUTION_MODULA = 0;
  123. /**
  124. * <p>Consistent hashing key distribution algorithm (based on libketama).</p>
  125. * @link http://php.net/manual/en/memcached.constants.php
  126. */
  127. const DISTRIBUTION_CONSISTENT = 1;
  128. const DISTRIBUTION_VIRTUAL_BUCKET = 6;
  129. /**
  130. * <p>Enables or disables compatibility with libketama-like behavior. When
  131. * enabled, the item key hashing algorithm is set to MD5 and distribution is
  132. * set to be weighted consistent hashing distribution. This is useful
  133. * because other libketama-based clients (Python, Ruby, etc.) with the same
  134. * server configuration will be able to access the keys transparently.
  135. * </p>
  136. * <p>
  137. * It is highly recommended to enable this option if you want to use
  138. * consistent hashing, and it may be enabled by default in future
  139. * releases.
  140. * </p>
  141. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  142. * @link http://php.net/manual/en/memcached.constants.php
  143. */
  144. const OPT_LIBKETAMA_COMPATIBLE = 16;
  145. const OPT_LIBKETAMA_HASH = 17;
  146. const OPT_TCP_KEEPALIVE = 32;
  147. /**
  148. * <p>Enables or disables buffered I/O. Enabling buffered I/O causes
  149. * storage commands to "buffer" instead of being sent. Any action that
  150. * retrieves data causes this buffer to be sent to the remote connection.
  151. * Quitting the connection or closing down the connection will also cause
  152. * the buffered data to be pushed to the remote connection.</p>
  153. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  154. * @link http://php.net/manual/en/memcached.constants.php
  155. */
  156. const OPT_BUFFER_WRITES = 10;
  157. /**
  158. * <p>Enable the use of the binary protocol. Please note that you cannot
  159. * toggle this option on an open connection.</p>
  160. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  161. * @link http://php.net/manual/en/memcached.constants.php
  162. */
  163. const OPT_BINARY_PROTOCOL = 18;
  164. /**
  165. * <p>Enables or disables asynchronous I/O. This is the fastest transport
  166. * available for storage functions.</p>
  167. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  168. * @link http://php.net/manual/en/memcached.constants.php
  169. */
  170. const OPT_NO_BLOCK = 0;
  171. /**
  172. * <p>Enables or disables the no-delay feature for connecting sockets (may
  173. * be faster in some environments).</p>
  174. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  175. * @link http://php.net/manual/en/memcached.constants.php
  176. */
  177. const OPT_TCP_NODELAY = 1;
  178. /**
  179. * <p>The maximum socket send buffer in bytes.</p>
  180. * <p>Type: integer, default: varies by platform/kernel
  181. * configuration.</p>
  182. * @link http://php.net/manual/en/memcached.constants.php
  183. */
  184. const OPT_SOCKET_SEND_SIZE = 4;
  185. /**
  186. * <p>The maximum socket receive buffer in bytes.</p>
  187. * <p>Type: integer, default: varies by platform/kernel
  188. * configuration.</p>
  189. * @link http://php.net/manual/en/memcached.constants.php
  190. */
  191. const OPT_SOCKET_RECV_SIZE = 5;
  192. /**
  193. * <p>In non-blocking mode this set the value of the timeout during socket
  194. * connection, in milliseconds.</p>
  195. * <p>Type: integer, default: 1000.</p>
  196. * @link http://php.net/manual/en/memcached.constants.php
  197. */
  198. const OPT_CONNECT_TIMEOUT = 14;
  199. /**
  200. * <p>The amount of time, in seconds, to wait until retrying a failed
  201. * connection attempt.</p>
  202. * <p>Type: integer, default: 0.</p>
  203. * @link http://php.net/manual/en/memcached.constants.php
  204. */
  205. const OPT_RETRY_TIMEOUT = 15;
  206. /**
  207. * <p>Socket sending timeout, in microseconds. In cases where you cannot
  208. * use non-blocking I/O this will allow you to still have timeouts on the
  209. * sending of data.</p>
  210. * <p>Type: integer, default: 0.</p>
  211. * @link http://php.net/manual/en/memcached.constants.php
  212. */
  213. const OPT_SEND_TIMEOUT = 19;
  214. /**
  215. * <p>Socket reading timeout, in microseconds. In cases where you cannot
  216. * use non-blocking I/O this will allow you to still have timeouts on the
  217. * reading of data.</p>
  218. * <p>Type: integer, default: 0.</p>
  219. * @link http://php.net/manual/en/memcached.constants.php
  220. */
  221. const OPT_RECV_TIMEOUT = 20;
  222. /**
  223. * <p>Timeout for connection polling, in milliseconds.</p>
  224. * <p>Type: integer, default: 1000.</p>
  225. * @link http://php.net/manual/en/memcached.constants.php
  226. */
  227. const OPT_POLL_TIMEOUT = 8;
  228. /**
  229. * <p>Enables or disables caching of DNS lookups.</p>
  230. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  231. * @link http://php.net/manual/en/memcached.constants.php
  232. */
  233. const OPT_CACHE_LOOKUPS = 6;
  234. /**
  235. * <p>Specifies the failure limit for server connection attempts. The
  236. * server will be removed after this many continuous connection
  237. * failures.</p>
  238. * <p>Type: integer, default: 0.</p>
  239. * @link http://php.net/manual/en/memcached.constants.php
  240. */
  241. const OPT_SERVER_FAILURE_LIMIT = 21;
  242. const OPT_AUTO_EJECT_HOSTS = 28;
  243. const OPT_HASH_WITH_PREFIX_KEY = 25;
  244. const OPT_NOREPLY = 26;
  245. const OPT_SORT_HOSTS = 12;
  246. const OPT_VERIFY_KEY = 13;
  247. const OPT_USE_UDP = 27;
  248. const OPT_NUMBER_OF_REPLICAS = 29;
  249. const OPT_RANDOMIZE_REPLICA_READ = 30;
  250. const OPT_REMOVE_FAILED_SERVERS = 35;
  251. /**
  252. * <p>The operation was successful.</p>
  253. * @link http://php.net/manual/en/memcached.constants.php
  254. */
  255. const RES_SUCCESS = 0;
  256. /**
  257. * <p>The operation failed in some fashion.</p>
  258. * @link http://php.net/manual/en/memcached.constants.php
  259. */
  260. const RES_FAILURE = 1;
  261. /**
  262. * <p>DNS lookup failed.</p>
  263. * @link http://php.net/manual/en/memcached.constants.php
  264. */
  265. const RES_HOST_LOOKUP_FAILURE = 2;
  266. /**
  267. * <p>Failed to read network data.</p>
  268. * @link http://php.net/manual/en/memcached.constants.php
  269. */
  270. const RES_UNKNOWN_READ_FAILURE = 7;
  271. /**
  272. * <p>Bad command in memcached protocol.</p>
  273. * @link http://php.net/manual/en/memcached.constants.php
  274. */
  275. const RES_PROTOCOL_ERROR = 8;
  276. /**
  277. * <p>Error on the client side.</p>
  278. * @link http://php.net/manual/en/memcached.constants.php
  279. */
  280. const RES_CLIENT_ERROR = 9;
  281. /**
  282. * <p>Error on the server side.</p>
  283. * @link http://php.net/manual/en/memcached.constants.php
  284. */
  285. const RES_SERVER_ERROR = 10;
  286. /**
  287. * <p>Failed to write network data.</p>
  288. * @link http://php.net/manual/en/memcached.constants.php
  289. */
  290. const RES_WRITE_FAILURE = 5;
  291. /**
  292. * <p>Failed to do compare-and-swap: item you are trying to store has been
  293. * modified since you last fetched it.</p>
  294. * @link http://php.net/manual/en/memcached.constants.php
  295. */
  296. const RES_DATA_EXISTS = 12;
  297. /**
  298. * <p>Item was not stored: but not because of an error. This normally
  299. * means that either the condition for an "add" or a "replace" command
  300. * wasn't met, or that the item is in a delete queue.</p>
  301. * @link http://php.net/manual/en/memcached.constants.php
  302. */
  303. const RES_NOTSTORED = 14;
  304. /**
  305. * <p>Item with this key was not found (with "get" operation or "cas"
  306. * operations).</p>
  307. * @link http://php.net/manual/en/memcached.constants.php
  308. */
  309. const RES_NOTFOUND = 16;
  310. /**
  311. * <p>Partial network data read error.</p>
  312. * @link http://php.net/manual/en/memcached.constants.php
  313. */
  314. const RES_PARTIAL_READ = 18;
  315. /**
  316. * <p>Some errors occurred during multi-get.</p>
  317. * @link http://php.net/manual/en/memcached.constants.php
  318. */
  319. const RES_SOME_ERRORS = 19;
  320. /**
  321. * <p>Server list is empty.</p>
  322. * @link http://php.net/manual/en/memcached.constants.php
  323. */
  324. const RES_NO_SERVERS = 20;
  325. /**
  326. * <p>End of result set.</p>
  327. * @link http://php.net/manual/en/memcached.constants.php
  328. */
  329. const RES_END = 21;
  330. /**
  331. * <p>System error.</p>
  332. * @link http://php.net/manual/en/memcached.constants.php
  333. */
  334. const RES_ERRNO = 26;
  335. /**
  336. * <p>The operation was buffered.</p>
  337. * @link http://php.net/manual/en/memcached.constants.php
  338. */
  339. const RES_BUFFERED = 32;
  340. /**
  341. * <p>The operation timed out.</p>
  342. * @link http://php.net/manual/en/memcached.constants.php
  343. */
  344. const RES_TIMEOUT = 31;
  345. /**
  346. * <p>Bad key.</p>
  347. * @link http://php.net/manual/en/memcached.constants.php
  348. */
  349. const RES_BAD_KEY_PROVIDED = 33;
  350. const RES_STORED = 15;
  351. const RES_DELETED = 22;
  352. const RES_STAT = 24;
  353. const RES_ITEM = 25;
  354. const RES_NOT_SUPPORTED = 28;
  355. const RES_FETCH_NOTFINISHED = 30;
  356. const RES_SERVER_MARKED_DEAD = 35;
  357. const RES_UNKNOWN_STAT_KEY = 36;
  358. const RES_INVALID_HOST_PROTOCOL = 34;
  359. const RES_MEMORY_ALLOCATION_FAILURE = 17;
  360. const RES_E2BIG = 37;
  361. const RES_KEY_TOO_BIG = 39;
  362. const RES_SERVER_TEMPORARILY_DISABLED = 47;
  363. const RES_SERVER_MEMORY_ALLOCATION_FAILURE = 48;
  364. const RES_AUTH_PROBLEM = 40;
  365. const RES_AUTH_FAILURE = 41;
  366. const RES_AUTH_CONTINUE = 42;
  367. /**
  368. * <p>Failed to create network socket.</p>
  369. * @link http://php.net/manual/en/memcached.constants.php
  370. */
  371. const RES_CONNECTION_SOCKET_CREATE_FAILURE = 11;
  372. /**
  373. * <p>Payload failure: could not compress/decompress or serialize/unserialize the value.</p>
  374. * @link http://php.net/manual/en/memcached.constants.php
  375. */
  376. const RES_PAYLOAD_FAILURE = -1001;
  377. /**
  378. * <p>The default PHP serializer.</p>
  379. * @link http://php.net/manual/en/memcached.constants.php
  380. */
  381. const SERIALIZER_PHP = 1;
  382. /**
  383. * <p>The igbinary serializer.
  384. * Instead of textual representation it stores PHP data structures in a
  385. * compact binary form, resulting in space and time gains.</p>
  386. * @link http://php.net/manual/en/memcached.constants.php
  387. */
  388. const SERIALIZER_IGBINARY = 2;
  389. /**
  390. * <p>The JSON serializer. Requires PHP 5.2.10+.</p>
  391. * @link http://php.net/manual/en/memcached.constants.php
  392. */
  393. const SERIALIZER_JSON = 3;
  394. const SERIALIZER_JSON_ARRAY = 4;
  395. const COMPRESSION_FASTLZ = 2;
  396. const COMPRESSION_ZLIB = 1;
  397. /**
  398. * <p>A flag for <b>Memcached::getMulti</b> and
  399. * <b>Memcached::getMultiByKey</b> to ensure that the keys are
  400. * returned in the same order as they were requested in. Non-existing keys
  401. * get a default value of NULL.</p>
  402. * @link http://php.net/manual/en/memcached.constants.php
  403. */
  404. const GET_PRESERVE_ORDER = 1;
  405. const GET_ERROR_RETURN_VALUE = false;
  406. /**
  407. * (PECL memcached &gt;= 0.1.0)<br/>
  408. * Create a Memcached instance
  409. * @link http://php.net/manual/en/memcached.construct.php
  410. * @param $persistent_id [optional]
  411. * @param $callback [optional]
  412. */
  413. public function __construct ($persistent_id, $callback) {}
  414. /**
  415. * (PECL memcached &gt;= 0.1.0)<br/>
  416. * Return the result code of the last operation
  417. * @link http://php.net/manual/en/memcached.getresultcode.php
  418. * @return int Result code of the last Memcached operation.
  419. */
  420. public function getResultCode () {}
  421. /**
  422. * (PECL memcached &gt;= 1.0.0)<br/>
  423. * Return the message describing the result of the last operation
  424. * @link http://php.net/manual/en/memcached.getresultmessage.php
  425. * @return string Message describing the result of the last Memcached operation.
  426. */
  427. public function getResultMessage () {}
  428. /**
  429. * (PECL memcached &gt;= 0.1.0)<br/>
  430. * Retrieve an item
  431. * @link http://php.net/manual/en/memcached.get.php
  432. * @param string $key <p>
  433. * The key of the item to retrieve.
  434. * </p>
  435. * @param callable $cache_cb [optional] <p>
  436. * Read-through caching callback or <b>NULL</b>.
  437. * </p>
  438. * @param float $cas_token [optional] <p>
  439. * The variable to store the CAS token in.
  440. * </p>
  441. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  442. * The <b>Memcached::getResultCode</b> will return
  443. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  444. */
  445. public function get ($key, callable $cache_cb = null, &$cas_token = null) {}
  446. /**
  447. * (PECL memcached &gt;= 0.1.0)<br/>
  448. * Retrieve an item from a specific server
  449. * @link http://php.net/manual/en/memcached.getbykey.php
  450. * @param string $server_key <p>
  451. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  452. * </p>
  453. * @param string $key <p>
  454. * The key of the item to fetch.
  455. * </p>
  456. * @param callable $cache_cb [optional] <p>
  457. * Read-through caching callback or <b>NULL</b>
  458. * </p>
  459. * @param float $cas_token [optional] <p>
  460. * The variable to store the CAS token in.
  461. * </p>
  462. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  463. * The <b>Memcached::getResultCode</b> will return
  464. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  465. */
  466. public function getByKey ($server_key, $key, callable $cache_cb = null, &$cas_token = null) {}
  467. /**
  468. * (PECL memcached &gt;= 0.1.0)<br/>
  469. * Retrieve multiple items
  470. * @link http://php.net/manual/en/memcached.getmulti.php
  471. * @param array $keys <p>
  472. * Array of keys to retrieve.
  473. * </p>
  474. * @param array $cas_tokens [optional] <p>
  475. * The variable to store the CAS tokens for the found items.
  476. * </p>
  477. * @param int $flags [optional] <p>
  478. * The flags for the get operation.
  479. * </p>
  480. * @return mixed the array of found items or <b>FALSE</b> on failure.
  481. * Use <b>Memcached::getResultCode</b> if necessary.
  482. */
  483. public function getMulti (array $keys, array &$cas_tokens = null, $flags = null) {}
  484. /**
  485. * (PECL memcached &gt;= 0.1.0)<br/>
  486. * Retrieve multiple items from a specific server
  487. * @link http://php.net/manual/en/memcached.getmultibykey.php
  488. * @param string $server_key <p>
  489. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  490. * </p>
  491. * @param array $keys <p>
  492. * Array of keys to retrieve.
  493. * </p>
  494. * @param string $cas_tokens [optional] <p>
  495. * The variable to store the CAS tokens for the found items.
  496. * </p>
  497. * @param int $flags [optional] <p>
  498. * The flags for the get operation.
  499. * </p>
  500. * @return array the array of found items or <b>FALSE</b> on failure.
  501. * Use <b>Memcached::getResultCode</b> if necessary.
  502. */
  503. public function getMultiByKey ($server_key, array $keys, &$cas_tokens = null, $flags = null) {}
  504. /**
  505. * (PECL memcached &gt;= 0.1.0)<br/>
  506. * Request multiple items
  507. * @link http://php.net/manual/en/memcached.getdelayed.php
  508. * @param array $keys <p>
  509. * Array of keys to request.
  510. * </p>
  511. * @param bool $with_cas [optional] <p>
  512. * Whether to request CAS token values also.
  513. * </p>
  514. * @param callable $value_cb [optional] <p>
  515. * The result callback or <b>NULL</b>.
  516. * </p>
  517. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  518. * Use <b>Memcached::getResultCode</b> if necessary.
  519. */
  520. public function getDelayed (array $keys, $with_cas = null, callable $value_cb = null) {}
  521. /**
  522. * (PECL memcached &gt;= 0.1.0)<br/>
  523. * Request multiple items from a specific server
  524. * @link http://php.net/manual/en/memcached.getdelayedbykey.php
  525. * @param string $server_key <p>
  526. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  527. * </p>
  528. * @param array $keys <p>
  529. * Array of keys to request.
  530. * </p>
  531. * @param bool $with_cas [optional] <p>
  532. * Whether to request CAS token values also.
  533. * </p>
  534. * @param callable $value_cb [optional] <p>
  535. * The result callback or <b>NULL</b>.
  536. * </p>
  537. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  538. * Use <b>Memcached::getResultCode</b> if necessary.
  539. */
  540. public function getDelayedByKey ($server_key, array $keys, $with_cas = null, callable $value_cb = null) {}
  541. /**
  542. * (PECL memcached &gt;= 0.1.0)<br/>
  543. * Fetch the next result
  544. * @link http://php.net/manual/en/memcached.fetch.php
  545. * @return array the next result or <b>FALSE</b> otherwise.
  546. * The <b>Memcached::getResultCode</b> will return
  547. * <b>Memcached::RES_END</b> if result set is exhausted.
  548. */
  549. public function fetch () {}
  550. /**
  551. * (PECL memcached &gt;= 0.1.0)<br/>
  552. * Fetch all the remaining results
  553. * @link http://php.net/manual/en/memcached.fetchall.php
  554. * @return array the results or <b>FALSE</b> on failure.
  555. * Use <b>Memcached::getResultCode</b> if necessary.
  556. */
  557. public function fetchAll () {}
  558. /**
  559. * (PECL memcached &gt;= 0.1.0)<br/>
  560. * Store an item
  561. * @link http://php.net/manual/en/memcached.set.php
  562. * @param string $key <p>
  563. * The key under which to store the value.
  564. * </p>
  565. * @param mixed $value <p>
  566. * The value to store.
  567. * </p>
  568. * @param int $expiration [optional] <p>
  569. * The expiration time, defaults to 0. See Expiration Times for more info.
  570. * </p>
  571. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  572. * Use <b>Memcached::getResultCode</b> if necessary.
  573. */
  574. public function set ($key, $value, $expiration = null) {}
  575. /**
  576. * (PECL memcached &gt;= 0.1.0)<br/>
  577. * Store an item on a specific server
  578. * @link http://php.net/manual/en/memcached.setbykey.php
  579. * @param string $server_key <p>
  580. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  581. * </p>
  582. * @param string $key <p>
  583. * The key under which to store the value.
  584. * </p>
  585. * @param mixed $value <p>
  586. * The value to store.
  587. * </p>
  588. * @param int $expiration [optional] <p>
  589. * The expiration time, defaults to 0. See Expiration Times for more info.
  590. * </p>
  591. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  592. * Use <b>Memcached::getResultCode</b> if necessary.
  593. */
  594. public function setByKey ($server_key, $key, $value, $expiration = null) {}
  595. /**
  596. * (PECL memcached &gt;= 2.0.0)<br/>
  597. * Set a new expiration on an item
  598. * @link http://php.net/manual/en/memcached.touch.php
  599. * @param string $key <p>
  600. * The key under which to store the value.
  601. * </p>
  602. * @param int $expiration <p>
  603. * The expiration time, defaults to 0. See Expiration Times for more info.
  604. * </p>
  605. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  606. * Use <b>Memcached::getResultCode</b> if necessary.
  607. */
  608. public function touch ($key, $expiration) {}
  609. /**
  610. * (PECL memcached &gt;= 2.0.0)<br/>
  611. * Set a new expiration on an item on a specific server
  612. * @link http://php.net/manual/en/memcached.touchbykey.php
  613. * @param string $server_key <p>
  614. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  615. * </p>
  616. * @param string $key <p>
  617. * The key under which to store the value.
  618. * </p>
  619. * @param int $expiration <p>
  620. * The expiration time, defaults to 0. See Expiration Times for more info.
  621. * </p>
  622. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  623. * Use <b>Memcached::getResultCode</b> if necessary.
  624. */
  625. public function touchByKey ($server_key, $key, $expiration) {}
  626. /**
  627. * (PECL memcached &gt;= 0.1.0)<br/>
  628. * Store multiple items
  629. * @link http://php.net/manual/en/memcached.setmulti.php
  630. * @param array $items <p>
  631. * An array of key/value pairs to store on the server.
  632. * </p>
  633. * @param int $expiration [optional] <p>
  634. * The expiration time, defaults to 0. See Expiration Times for more info.
  635. * </p>
  636. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  637. * Use <b>Memcached::getResultCode</b> if necessary.
  638. */
  639. public function setMulti (array $items, $expiration = null) {}
  640. /**
  641. * (PECL memcached &gt;= 0.1.0)<br/>
  642. * Store multiple items on a specific server
  643. * @link http://php.net/manual/en/memcached.setmultibykey.php
  644. * @param string $server_key <p>
  645. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  646. * </p>
  647. * @param array $items <p>
  648. * An array of key/value pairs to store on the server.
  649. * </p>
  650. * @param int $expiration [optional] <p>
  651. * The expiration time, defaults to 0. See Expiration Times for more info.
  652. * </p>
  653. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  654. * Use <b>Memcached::getResultCode</b> if necessary.
  655. */
  656. public function setMultiByKey ($server_key, array $items, $expiration = null) {}
  657. /**
  658. * (PECL memcached &gt;= 0.1.0)<br/>
  659. * Compare and swap an item
  660. * @link http://php.net/manual/en/memcached.cas.php
  661. * @param float $cas_token <p>
  662. * Unique value associated with the existing item. Generated by memcache.
  663. * </p>
  664. * @param string $key <p>
  665. * The key under which to store the value.
  666. * </p>
  667. * @param mixed $value <p>
  668. * The value to store.
  669. * </p>
  670. * @param int $expiration [optional] <p>
  671. * The expiration time, defaults to 0. See Expiration Times for more info.
  672. * </p>
  673. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  674. * The <b>Memcached::getResultCode</b> will return
  675. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  676. * to store has been modified since you last fetched it.
  677. */
  678. public function cas ($cas_token, $key, $value, $expiration = null) {}
  679. /**
  680. * (PECL memcached &gt;= 0.1.0)<br/>
  681. * Compare and swap an item on a specific server
  682. * @link http://php.net/manual/en/memcached.casbykey.php
  683. * @param float $cas_token <p>
  684. * Unique value associated with the existing item. Generated by memcache.
  685. * </p>
  686. * @param string $server_key <p>
  687. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  688. * </p>
  689. * @param string $key <p>
  690. * The key under which to store the value.
  691. * </p>
  692. * @param mixed $value <p>
  693. * The value to store.
  694. * </p>
  695. * @param int $expiration [optional] <p>
  696. * The expiration time, defaults to 0. See Expiration Times for more info.
  697. * </p>
  698. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  699. * The <b>Memcached::getResultCode</b> will return
  700. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  701. * to store has been modified since you last fetched it.
  702. */
  703. public function casByKey ($cas_token, $server_key, $key, $value, $expiration = null) {}
  704. /**
  705. * (PECL memcached &gt;= 0.1.0)<br/>
  706. * Add an item under a new key
  707. * @link http://php.net/manual/en/memcached.add.php
  708. * @param string $key <p>
  709. * The key under which to store the value.
  710. * </p>
  711. * @param mixed $value <p>
  712. * The value to store.
  713. * </p>
  714. * @param int $expiration [optional] <p>
  715. * The expiration time, defaults to 0. See Expiration Times for more info.
  716. * </p>
  717. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  718. * The <b>Memcached::getResultCode</b> will return
  719. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  720. */
  721. public function add ($key, $value, $expiration = null) {}
  722. /**
  723. * (PECL memcached &gt;= 0.1.0)<br/>
  724. * Add an item under a new key on a specific server
  725. * @link http://php.net/manual/en/memcached.addbykey.php
  726. * @param string $server_key <p>
  727. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  728. * </p>
  729. * @param string $key <p>
  730. * The key under which to store the value.
  731. * </p>
  732. * @param mixed $value <p>
  733. * The value to store.
  734. * </p>
  735. * @param int $expiration [optional] <p>
  736. * The expiration time, defaults to 0. See Expiration Times for more info.
  737. * </p>
  738. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  739. * The <b>Memcached::getResultCode</b> will return
  740. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  741. */
  742. public function addByKey ($server_key, $key, $value, $expiration = null) {}
  743. /**
  744. * (PECL memcached &gt;= 0.1.0)<br/>
  745. * Append data to an existing item
  746. * @link http://php.net/manual/en/memcached.append.php
  747. * @param string $key <p>
  748. * The key under which to store the value.
  749. * </p>
  750. * @param string $value <p>
  751. * The string to append.
  752. * </p>
  753. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  754. * The <b>Memcached::getResultCode</b> will return
  755. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  756. */
  757. public function append ($key, $value) {}
  758. /**
  759. * (PECL memcached &gt;= 0.1.0)<br/>
  760. * Append data to an existing item on a specific server
  761. * @link http://php.net/manual/en/memcached.appendbykey.php
  762. * @param string $server_key <p>
  763. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  764. * </p>
  765. * @param string $key <p>
  766. * The key under which to store the value.
  767. * </p>
  768. * @param string $value <p>
  769. * The string to append.
  770. * </p>
  771. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  772. * The <b>Memcached::getResultCode</b> will return
  773. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  774. */
  775. public function appendByKey ($server_key, $key, $value) {}
  776. /**
  777. * (PECL memcached &gt;= 0.1.0)<br/>
  778. * Prepend data to an existing item
  779. * @link http://php.net/manual/en/memcached.prepend.php
  780. * @param string $key <p>
  781. * The key of the item to prepend the data to.
  782. * </p>
  783. * @param string $value <p>
  784. * The string to prepend.
  785. * </p>
  786. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  787. * The <b>Memcached::getResultCode</b> will return
  788. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  789. */
  790. public function prepend ($key, $value) {}
  791. /**
  792. * (PECL memcached &gt;= 0.1.0)<br/>
  793. * Prepend data to an existing item on a specific server
  794. * @link http://php.net/manual/en/memcached.prependbykey.php
  795. * @param string $server_key <p>
  796. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  797. * </p>
  798. * @param string $key <p>
  799. * The key of the item to prepend the data to.
  800. * </p>
  801. * @param string $value <p>
  802. * The string to prepend.
  803. * </p>
  804. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  805. * The <b>Memcached::getResultCode</b> will return
  806. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  807. */
  808. public function prependByKey ($server_key, $key, $value) {}
  809. /**
  810. * (PECL memcached &gt;= 0.1.0)<br/>
  811. * Replace the item under an existing key
  812. * @link http://php.net/manual/en/memcached.replace.php
  813. * @param string $key <p>
  814. * The key under which to store the value.
  815. * </p>
  816. * @param mixed $value <p>
  817. * The value to store.
  818. * </p>
  819. * @param int $expiration [optional] <p>
  820. * The expiration time, defaults to 0. See Expiration Times for more info.
  821. * </p>
  822. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  823. * The <b>Memcached::getResultCode</b> will return
  824. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  825. */
  826. public function replace ($key, $value, $expiration = null) {}
  827. /**
  828. * (PECL memcached &gt;= 0.1.0)<br/>
  829. * Replace the item under an existing key on a specific server
  830. * @link http://php.net/manual/en/memcached.replacebykey.php
  831. * @param string $server_key <p>
  832. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  833. * </p>
  834. * @param string $key <p>
  835. * The key under which to store the value.
  836. * </p>
  837. * @param mixed $value <p>
  838. * The value to store.
  839. * </p>
  840. * @param int $expiration [optional] <p>
  841. * The expiration time, defaults to 0. See Expiration Times for more info.
  842. * </p>
  843. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  844. * The <b>Memcached::getResultCode</b> will return
  845. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  846. */
  847. public function replaceByKey ($server_key, $key, $value, $expiration = null) {}
  848. /**
  849. * (PECL memcached &gt;= 0.1.0)<br/>
  850. * Delete an item
  851. * @link http://php.net/manual/en/memcached.delete.php
  852. * @param string $key <p>
  853. * The key to be deleted.
  854. * </p>
  855. * @param int $time [optional] <p>
  856. * The amount of time the server will wait to delete the item.
  857. * </p>
  858. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  859. * The <b>Memcached::getResultCode</b> will return
  860. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  861. */
  862. public function delete ($key, $time = 0) {}
  863. /**
  864. * (PECL memcached &gt;= 2.0.0)<br/>
  865. * Delete multiple items
  866. * @link http://php.net/manual/en/memcached.deletemulti.php
  867. * @param array $keys <p>
  868. * The keys to be deleted.
  869. * </p>
  870. * @param int $time [optional] <p>
  871. * The amount of time the server will wait to delete the items.
  872. * </p>
  873. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  874. * The <b>Memcached::getResultCode</b> will return
  875. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  876. */
  877. public function deleteMulti (array $keys, $time = 0) {}
  878. /**
  879. * (PECL memcached &gt;= 0.1.0)<br/>
  880. * Delete an item from a specific server
  881. * @link http://php.net/manual/en/memcached.deletebykey.php
  882. * @param string $server_key <p>
  883. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  884. * </p>
  885. * @param string $key <p>
  886. * The key to be deleted.
  887. * </p>
  888. * @param int $time [optional] <p>
  889. * The amount of time the server will wait to delete the item.
  890. * </p>
  891. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  892. * The <b>Memcached::getResultCode</b> will return
  893. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  894. */
  895. public function deleteByKey ($server_key, $key, $time = 0) {}
  896. /**
  897. * (PECL memcached &gt;= 2.0.0)<br/>
  898. * Delete multiple items from a specific server
  899. * @link http://php.net/manual/en/memcached.deletemultibykey.php
  900. * @param string $server_key <p>
  901. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  902. * </p>
  903. * @param array $keys <p>
  904. * The keys to be deleted.
  905. * </p>
  906. * @param int $time [optional] <p>
  907. * The amount of time the server will wait to delete the items.
  908. * </p>
  909. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  910. * The <b>Memcached::getResultCode</b> will return
  911. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  912. */
  913. public function deleteMultiByKey ($server_key, array $keys, $time = 0) {}
  914. /**
  915. * (PECL memcached &gt;= 0.1.0)<br/>
  916. * Increment numeric item's value
  917. * @link http://php.net/manual/en/memcached.increment.php
  918. * @param string $key <p>
  919. * The key of the item to increment.
  920. * </p>
  921. * @param int $offset [optional] <p>
  922. * The amount by which to increment the item's value.
  923. * </p>
  924. * @param int $initial_value [optional] <p>
  925. * The value to set the item to if it doesn't currently exist.
  926. * </p>
  927. * @param int $expiry [optional] <p>
  928. * The expiry time to set on the item.
  929. * </p>
  930. * @return int new item's value on success or <b>FALSE</b> on failure.
  931. */
  932. public function increment ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  933. /**
  934. * (PECL memcached &gt;= 0.1.0)<br/>
  935. * Decrement numeric item's value
  936. * @link http://php.net/manual/en/memcached.decrement.php
  937. * @param string $key <p>
  938. * The key of the item to decrement.
  939. * </p>
  940. * @param int $offset [optional] <p>
  941. * The amount by which to decrement the item's value.
  942. * </p>
  943. * @param int $initial_value [optional] <p>
  944. * The value to set the item to if it doesn't currently exist.
  945. * </p>
  946. * @param int $expiry [optional] <p>
  947. * The expiry time to set on the item.
  948. * </p>
  949. * @return int item's new value on success or <b>FALSE</b> on failure.
  950. */
  951. public function decrement ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  952. /**
  953. * (PECL memcached &gt;= 2.0.0)<br/>
  954. * Increment numeric item's value, stored on a specific server
  955. * @link http://php.net/manual/en/memcached.incrementbykey.php
  956. * @param string $server_key <p>
  957. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  958. * </p>
  959. * @param string $key <p>
  960. * The key of the item to increment.
  961. * </p>
  962. * @param int $offset [optional] <p>
  963. * The amount by which to increment the item's value.
  964. * </p>
  965. * @param int $initial_value [optional] <p>
  966. * The value to set the item to if it doesn't currently exist.
  967. * </p>
  968. * @param int $expiry [optional] <p>
  969. * The expiry time to set on the item.
  970. * </p>
  971. * @return int new item's value on success or <b>FALSE</b> on failure.
  972. */
  973. public function incrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  974. /**
  975. * (PECL memcached &gt;= 2.0.0)<br/>
  976. * Decrement numeric item's value, stored on a specific server
  977. * @link http://php.net/manual/en/memcached.decrementbykey.php
  978. * @param string $server_key <p>
  979. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  980. * </p>
  981. * @param string $key <p>
  982. * The key of the item to decrement.
  983. * </p>
  984. * @param int $offset [optional] <p>
  985. * The amount by which to decrement the item's value.
  986. * </p>
  987. * @param int $initial_value [optional] <p>
  988. * The value to set the item to if it doesn't currently exist.
  989. * </p>
  990. * @param int $expiry [optional] <p>
  991. * The expiry time to set on the item.
  992. * </p>
  993. * @return int item's new value on success or <b>FALSE</b> on failure.
  994. */
  995. public function decrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  996. /**
  997. * (PECL memcached &gt;= 0.1.0)<br/>
  998. * Add a server to the server pool
  999. * @link http://php.net/manual/en/memcached.addserver.php
  1000. * @param string $host <p>
  1001. * The hostname of the memcache server. If the hostname is invalid, data-related
  1002. * operations will set
  1003. * <b>Memcached::RES_HOST_LOOKUP_FAILURE</b> result code.
  1004. * </p>
  1005. * @param int $port <p>
  1006. * The port on which memcache is running. Usually, this is
  1007. * 11211.
  1008. * </p>
  1009. * @param int $weight [optional] <p>
  1010. * The weight of the server relative to the total weight of all the
  1011. * servers in the pool. This controls the probability of the server being
  1012. * selected for operations. This is used only with consistent distribution
  1013. * option and usually corresponds to the amount of memory available to
  1014. * memcache on that server.
  1015. * </p>
  1016. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1017. */
  1018. public function addServer ($host, $port, $weight = 0) {}
  1019. /**
  1020. * (PECL memcached &gt;= 0.1.1)<br/>
  1021. * Add multiple servers to the server pool
  1022. * @link http://php.net/manual/en/memcached.addservers.php
  1023. * @param array $servers
  1024. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1025. */
  1026. public function addServers (array $servers) {}
  1027. /**
  1028. * (PECL memcached &gt;= 0.1.0)<br/>
  1029. * Get the list of the servers in the pool
  1030. * @link http://php.net/manual/en/memcached.getserverlist.php
  1031. * @return array The list of all servers in the server pool.
  1032. */
  1033. public function getServerList () {}
  1034. /**
  1035. * (PECL memcached &gt;= 0.1.0)<br/>
  1036. * Map a key to a server
  1037. * @link http://php.net/manual/en/memcached.getserverbykey.php
  1038. * @param string $server_key <p>
  1039. * The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
  1040. * </p>
  1041. * @return array an array containing three keys of host,
  1042. * port, and weight on success or <b>FALSE</b>
  1043. * on failure.
  1044. * Use <b>Memcached::getResultCode</b> if necessary.
  1045. */
  1046. public function getServerByKey ($server_key) {}
  1047. /**
  1048. * (PECL memcached &gt;= 2.0.0)<br/>
  1049. * Clears all servers from the server list
  1050. * @link http://php.net/manual/en/memcached.resetserverlist.php
  1051. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1052. */
  1053. public function resetServerList () {}
  1054. /**
  1055. * (PECL memcached &gt;= 2.0.0)<br/>
  1056. * Close any open connections
  1057. * @link http://php.net/manual/en/memcached.quit.php
  1058. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1059. */
  1060. public function quit () {}
  1061. /**
  1062. * (PECL memcached &gt;= 0.1.0)<br/>
  1063. * Get server pool statistics
  1064. * @link http://php.net/manual/en/memcached.getstats.php
  1065. * @return array Array of server statistics, one entry per server.
  1066. */
  1067. public function getStats () {}
  1068. /**
  1069. * (PECL memcached &gt;= 0.1.5)<br/>
  1070. * Get server pool version info
  1071. * @link http://php.net/manual/en/memcached.getversion.php
  1072. * @return array Array of server versions, one entry per server.
  1073. */
  1074. public function getVersion () {}
  1075. /**
  1076. * (PECL memcached &gt;= 2.0.0)<br/>
  1077. * Gets the keys stored on all the servers
  1078. * @link http://php.net/manual/en/memcached.getallkeys.php
  1079. * @return array the keys stored on all the servers on success or <b>FALSE</b> on failure.
  1080. */
  1081. public function getAllKeys () {}
  1082. /**
  1083. * (PECL memcached &gt;= 0.1.0)<br/>
  1084. * Invalidate all items in the cache
  1085. * @link http://php.net/manual/en/memcached.flush.php
  1086. * @param int $delay [optional] <p>
  1087. * Numer of seconds to wait before invalidating the items.
  1088. * </p>
  1089. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1090. * Use <b>Memcached::getResultCode</b> if necessary.
  1091. */
  1092. public function flush ($delay = 0) {}
  1093. /**
  1094. * (PECL memcached &gt;= 0.1.0)<br/>
  1095. * Retrieve a Memcached option value
  1096. * @link http://php.net/manual/en/memcached.getoption.php
  1097. * @param int $option <p>
  1098. * One of the Memcached::OPT_* constants.
  1099. * </p>
  1100. * @return mixed the value of the requested option, or <b>FALSE</b> on
  1101. * error.
  1102. */
  1103. public function getOption ($option) {}
  1104. /**
  1105. * (PECL memcached &gt;= 0.1.0)<br/>
  1106. * Set a Memcached option
  1107. * @link http://php.net/manual/en/memcached.setoption.php
  1108. * @param int $option
  1109. * @param mixed $value
  1110. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1111. */
  1112. public function setOption ($option, $value) {}
  1113. /**
  1114. * (PECL memcached &gt;= 2.0.0)<br/>
  1115. * Set Memcached options
  1116. * @link http://php.net/manual/en/memcached.setoptions.php
  1117. * @param array $options <p>
  1118. * An associative array of options where the key is the option to set and
  1119. * the value is the new value for the option.
  1120. * </p>
  1121. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1122. */
  1123. public function setOptions (array $options) {}
  1124. /**
  1125. * (PECL memcached &gt;= 2.0.0)<br/>
  1126. * Check if a persitent connection to memcache is being used
  1127. * @link http://php.net/manual/en/memcached.ispersistent.php
  1128. * @return bool true if Memcache instance uses a persistent connection, false otherwise.
  1129. */
  1130. public function isPersistent () {}
  1131. /**
  1132. * (PECL memcached &gt;= 2.0.0)<br/>
  1133. * Check if the instance was recently created
  1134. * @link http://php.net/manual/en/memcached.ispristine.php
  1135. * @return bool the true if instance is recently created, false otherwise.
  1136. */
  1137. public function isPristine () {}
  1138. }
  1139. /**
  1140. * @link http://php.net/manual/en/class.memcachedexception.php
  1141. */
  1142. class MemcachedException extends RuntimeException {
  1143. }
  1144. // End of memcached v.2.1.0