memcached.php 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  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