1
0

memcached.php 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528
  1. <?php
  2. // Start of memcached v.3.1.5
  3. /**
  4. * Represents a connection to a set of memcached servers.
  5. * @link https://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 https://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 https://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 https://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 https://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 https://php.net/manual/en/memcached.constants.php
  51. */
  52. const HAVE_JSON = 0;
  53. /**
  54. * <p>Indicates whether msgpack serializer support is available.</p>
  55. * <p>Type: boolean.</p>
  56. * Available as of Memcached 3.0.0.
  57. * @since 3.0.0
  58. * @link https://php.net/manual/en/memcached.constants.php
  59. */
  60. const HAVE_MSGPACK = 0;
  61. /**
  62. * <p>Indicate whether set_encoding_key is available</p>
  63. * <p>Type: boolean.</p>
  64. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/memcached-api.php, https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c#L4387
  65. */
  66. const HAVE_ENCODING = 0;
  67. /**
  68. * Feature support
  69. */
  70. const HAVE_SESSION = 1;
  71. const HAVE_SASL = 0;
  72. /**
  73. * <p>Specifies the hashing algorithm used for the item keys. The valid
  74. * values are supplied via <b>Memcached::HASH_*</b> constants.
  75. * Each hash algorithm has its advantages and its disadvantages. Go with the
  76. * default if you don't know or don't care.</p>
  77. * <p>Type: integer, default: <b>Memcached::HASH_DEFAULT</b></p>
  78. * @link https://php.net/manual/en/memcached.constants.php
  79. */
  80. const OPT_HASH = 2;
  81. /**
  82. * <p>The default (Jenkins one-at-a-time) item key hashing algorithm.</p>
  83. * @link https://php.net/manual/en/memcached.constants.php
  84. */
  85. const HASH_DEFAULT = 0;
  86. /**
  87. * <p>MD5 item key hashing algorithm.</p>
  88. * @link https://php.net/manual/en/memcached.constants.php
  89. */
  90. const HASH_MD5 = 1;
  91. /**
  92. * <p>CRC item key hashing algorithm.</p>
  93. * @link https://php.net/manual/en/memcached.constants.php
  94. */
  95. const HASH_CRC = 2;
  96. /**
  97. * <p>FNV1_64 item key hashing algorithm.</p>
  98. * @link https://php.net/manual/en/memcached.constants.php
  99. */
  100. const HASH_FNV1_64 = 3;
  101. /**
  102. * <p>FNV1_64A item key hashing algorithm.</p>
  103. * @link https://php.net/manual/en/memcached.constants.php
  104. */
  105. const HASH_FNV1A_64 = 4;
  106. /**
  107. * <p>FNV1_32 item key hashing algorithm.</p>
  108. * @link https://php.net/manual/en/memcached.constants.php
  109. */
  110. const HASH_FNV1_32 = 5;
  111. /**
  112. * <p>FNV1_32A item key hashing algorithm.</p>
  113. * @link https://php.net/manual/en/memcached.constants.php
  114. */
  115. const HASH_FNV1A_32 = 6;
  116. /**
  117. * <p>Hsieh item key hashing algorithm.</p>
  118. * @link https://php.net/manual/en/memcached.constants.php
  119. */
  120. const HASH_HSIEH = 7;
  121. /**
  122. * <p>Murmur item key hashing algorithm.</p>
  123. * @link https://php.net/manual/en/memcached.constants.php
  124. */
  125. const HASH_MURMUR = 8;
  126. /**
  127. * <p>Specifies the method of distributing item keys to the servers.
  128. * Currently supported methods are modulo and consistent hashing. Consistent
  129. * hashing delivers better distribution and allows servers to be added to
  130. * the cluster with minimal cache losses.</p>
  131. * <p>Type: integer, default: <b>Memcached::DISTRIBUTION_MODULA.</b></p>
  132. * @link https://php.net/manual/en/memcached.constants.php
  133. */
  134. const OPT_DISTRIBUTION = 9;
  135. /**
  136. * <p>Modulo-based key distribution algorithm.</p>
  137. * @link https://php.net/manual/en/memcached.constants.php
  138. */
  139. const DISTRIBUTION_MODULA = 0;
  140. /**
  141. * <p>Consistent hashing key distribution algorithm (based on libketama).</p>
  142. * @link https://php.net/manual/en/memcached.constants.php
  143. */
  144. const DISTRIBUTION_CONSISTENT = 1;
  145. const DISTRIBUTION_VIRTUAL_BUCKET = 6;
  146. /**
  147. * <p>Enables or disables compatibility with libketama-like behavior. When
  148. * enabled, the item key hashing algorithm is set to MD5 and distribution is
  149. * set to be weighted consistent hashing distribution. This is useful
  150. * because other libketama-based clients (Python, Ruby, etc.) with the same
  151. * server configuration will be able to access the keys transparently.
  152. * </p>
  153. * <p>
  154. * It is highly recommended to enable this option if you want to use
  155. * consistent hashing, and it may be enabled by default in future
  156. * releases.
  157. * </p>
  158. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  159. * @link https://php.net/manual/en/memcached.constants.php
  160. */
  161. const OPT_LIBKETAMA_COMPATIBLE = 16;
  162. const OPT_LIBKETAMA_HASH = 17;
  163. const OPT_TCP_KEEPALIVE = 32;
  164. /**
  165. * <p>Enables or disables buffered I/O. Enabling buffered I/O causes
  166. * storage commands to "buffer" instead of being sent. Any action that
  167. * retrieves data causes this buffer to be sent to the remote connection.
  168. * Quitting the connection or closing down the connection will also cause
  169. * the buffered data to be pushed to the remote connection.</p>
  170. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  171. * @link https://php.net/manual/en/memcached.constants.php
  172. */
  173. const OPT_BUFFER_WRITES = 10;
  174. /**
  175. * <p>Enable the use of the binary protocol. Please note that you cannot
  176. * toggle this option on an open connection.</p>
  177. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  178. * @link https://php.net/manual/en/memcached.constants.php
  179. */
  180. const OPT_BINARY_PROTOCOL = 18;
  181. /**
  182. * <p>Enables or disables asynchronous I/O. This is the fastest transport
  183. * available for storage functions.</p>
  184. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  185. * @link https://php.net/manual/en/memcached.constants.php
  186. */
  187. const OPT_NO_BLOCK = 0;
  188. /**
  189. * <p>Enables or disables the no-delay feature for connecting sockets (may
  190. * be faster in some environments).</p>
  191. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  192. * @link https://php.net/manual/en/memcached.constants.php
  193. */
  194. const OPT_TCP_NODELAY = 1;
  195. /**
  196. * <p>The maximum socket send buffer in bytes.</p>
  197. * <p>Type: integer, default: varies by platform/kernel
  198. * configuration.</p>
  199. * @link https://php.net/manual/en/memcached.constants.php
  200. */
  201. const OPT_SOCKET_SEND_SIZE = 4;
  202. /**
  203. * <p>The maximum socket receive buffer in bytes.</p>
  204. * <p>Type: integer, default: varies by platform/kernel
  205. * configuration.</p>
  206. * @link https://php.net/manual/en/memcached.constants.php
  207. */
  208. const OPT_SOCKET_RECV_SIZE = 5;
  209. /**
  210. * <p>In non-blocking mode this set the value of the timeout during socket
  211. * connection, in milliseconds.</p>
  212. * <p>Type: integer, default: 1000.</p>
  213. * @link https://php.net/manual/en/memcached.constants.php
  214. */
  215. const OPT_CONNECT_TIMEOUT = 14;
  216. /**
  217. * <p>The amount of time, in seconds, to wait until retrying a failed
  218. * connection attempt.</p>
  219. * <p>Type: integer, default: 0.</p>
  220. * @link https://php.net/manual/en/memcached.constants.php
  221. */
  222. const OPT_RETRY_TIMEOUT = 15;
  223. /**
  224. * <p>Socket sending timeout, in microseconds. In cases where you cannot
  225. * use non-blocking I/O this will allow you to still have timeouts on the
  226. * sending of data.</p>
  227. * <p>Type: integer, default: 0.</p>
  228. * @link https://php.net/manual/en/memcached.constants.php
  229. */
  230. const OPT_SEND_TIMEOUT = 19;
  231. /**
  232. * <p>Socket reading timeout, in microseconds. In cases where you cannot
  233. * use non-blocking I/O this will allow you to still have timeouts on the
  234. * reading of data.</p>
  235. * <p>Type: integer, default: 0.</p>
  236. * @link https://php.net/manual/en/memcached.constants.php
  237. */
  238. const OPT_RECV_TIMEOUT = 20;
  239. /**
  240. * <p>Timeout for connection polling, in milliseconds.</p>
  241. * <p>Type: integer, default: 1000.</p>
  242. * @link https://php.net/manual/en/memcached.constants.php
  243. */
  244. const OPT_POLL_TIMEOUT = 8;
  245. /**
  246. * <p>Enables or disables caching of DNS lookups.</p>
  247. * <p>Type: boolean, default: <b>FALSE</b>.</p>
  248. * @link https://php.net/manual/en/memcached.constants.php
  249. */
  250. const OPT_CACHE_LOOKUPS = 6;
  251. /**
  252. * <p>Specifies the failure limit for server connection attempts. The
  253. * server will be removed after this many continuous connection
  254. * failures.</p>
  255. * <p>Type: integer, default: 0.</p>
  256. * @link https://php.net/manual/en/memcached.constants.php
  257. */
  258. const OPT_SERVER_FAILURE_LIMIT = 21;
  259. const OPT_AUTO_EJECT_HOSTS = 28;
  260. const OPT_HASH_WITH_PREFIX_KEY = 25;
  261. const OPT_NOREPLY = 26;
  262. const OPT_SORT_HOSTS = 12;
  263. const OPT_VERIFY_KEY = 13;
  264. const OPT_USE_UDP = 27;
  265. const OPT_NUMBER_OF_REPLICAS = 29;
  266. const OPT_RANDOMIZE_REPLICA_READ = 30;
  267. const OPT_CORK = 31;
  268. const OPT_REMOVE_FAILED_SERVERS = 35;
  269. const OPT_DEAD_TIMEOUT = 36;
  270. const OPT_SERVER_TIMEOUT_LIMIT = 37;
  271. const OPT_MAX = 38;
  272. const OPT_IO_BYTES_WATERMARK = 23;
  273. const OPT_IO_KEY_PREFETCH = 24;
  274. const OPT_IO_MSG_WATERMARK = 22;
  275. const OPT_LOAD_FROM_FILE = 34;
  276. const OPT_SUPPORT_CAS = 7;
  277. const OPT_TCP_KEEPIDLE = 33;
  278. const OPT_USER_DATA = 11;
  279. /**
  280. * libmemcached result codes
  281. */
  282. /**
  283. * <p>The operation was successful.</p>
  284. * @link https://php.net/manual/en/memcached.constants.php
  285. */
  286. const RES_SUCCESS = 0;
  287. /**
  288. * <p>The operation failed in some fashion.</p>
  289. * @link https://php.net/manual/en/memcached.constants.php
  290. */
  291. const RES_FAILURE = 1;
  292. /**
  293. * <p>DNS lookup failed.</p>
  294. * @link https://php.net/manual/en/memcached.constants.php
  295. */
  296. const RES_HOST_LOOKUP_FAILURE = 2;
  297. /**
  298. * <p>Failed to read network data.</p>
  299. * @link https://php.net/manual/en/memcached.constants.php
  300. */
  301. const RES_UNKNOWN_READ_FAILURE = 7;
  302. /**
  303. * <p>Bad command in memcached protocol.</p>
  304. * @link https://php.net/manual/en/memcached.constants.php
  305. */
  306. const RES_PROTOCOL_ERROR = 8;
  307. /**
  308. * <p>Error on the client side.</p>
  309. * @link https://php.net/manual/en/memcached.constants.php
  310. */
  311. const RES_CLIENT_ERROR = 9;
  312. /**
  313. * <p>Error on the server side.</p>
  314. * @link https://php.net/manual/en/memcached.constants.php
  315. */
  316. const RES_SERVER_ERROR = 10;
  317. /**
  318. * <p>Failed to write network data.</p>
  319. * @link https://php.net/manual/en/memcached.constants.php
  320. */
  321. const RES_WRITE_FAILURE = 5;
  322. /**
  323. * <p>Failed to do compare-and-swap: item you are trying to store has been
  324. * modified since you last fetched it.</p>
  325. * @link https://php.net/manual/en/memcached.constants.php
  326. */
  327. const RES_DATA_EXISTS = 12;
  328. /**
  329. * <p>Item was not stored: but not because of an error. This normally
  330. * means that either the condition for an "add" or a "replace" command
  331. * wasn't met, or that the item is in a delete queue.</p>
  332. * @link https://php.net/manual/en/memcached.constants.php
  333. */
  334. const RES_NOTSTORED = 14;
  335. /**
  336. * <p>Item with this key was not found (with "get" operation or "cas"
  337. * operations).</p>
  338. * @link https://php.net/manual/en/memcached.constants.php
  339. */
  340. const RES_NOTFOUND = 16;
  341. /**
  342. * <p>Partial network data read error.</p>
  343. * @link https://php.net/manual/en/memcached.constants.php
  344. */
  345. const RES_PARTIAL_READ = 18;
  346. /**
  347. * <p>Some errors occurred during multi-get.</p>
  348. * @link https://php.net/manual/en/memcached.constants.php
  349. */
  350. const RES_SOME_ERRORS = 19;
  351. /**
  352. * <p>Server list is empty.</p>
  353. * @link https://php.net/manual/en/memcached.constants.php
  354. */
  355. const RES_NO_SERVERS = 20;
  356. /**
  357. * <p>End of result set.</p>
  358. * @link https://php.net/manual/en/memcached.constants.php
  359. */
  360. const RES_END = 21;
  361. /**
  362. * <p>System error.</p>
  363. * @link https://php.net/manual/en/memcached.constants.php
  364. */
  365. const RES_ERRNO = 26;
  366. /**
  367. * <p>The operation was buffered.</p>
  368. * @link https://php.net/manual/en/memcached.constants.php
  369. */
  370. const RES_BUFFERED = 32;
  371. /**
  372. * <p>The operation timed out.</p>
  373. * @link https://php.net/manual/en/memcached.constants.php
  374. */
  375. const RES_TIMEOUT = 31;
  376. /**
  377. * <p>Bad key.</p>
  378. * @link https://php.net/manual/en/memcached.constants.php, http://docs.libmemcached.org/index.html
  379. */
  380. /**
  381. * <p>MEMCACHED_BAD_KEY_PROVIDED: The key provided is not a valid key.</p>
  382. */
  383. const RES_BAD_KEY_PROVIDED = 33;
  384. /**
  385. * <p>MEMCACHED_STORED: The requested object has been successfully stored on the server.</p>
  386. */
  387. const RES_STORED = 15;
  388. /**
  389. * <p>MEMCACHED_DELETED: The object requested by the key has been deleted.</p>
  390. */
  391. const RES_DELETED = 22;
  392. /**
  393. * <p>MEMCACHED_STAT: A “stat” command has been returned in the protocol.</p>
  394. */
  395. const RES_STAT = 24;
  396. /**
  397. * <p>MEMCACHED_ITEM: An item has been fetched (this is an internal error only).</p>
  398. */
  399. const RES_ITEM = 25;
  400. /**
  401. * <p>MEMCACHED_NOT_SUPPORTED: The given method is not supported in the server.</p>
  402. */
  403. const RES_NOT_SUPPORTED = 28;
  404. /**
  405. * <p>MEMCACHED_FETCH_NOTFINISHED: A request has been made, but the server has not finished the fetch of the last request.</p>
  406. */
  407. const RES_FETCH_NOTFINISHED = 30;
  408. /**
  409. * <p>MEMCACHED_SERVER_MARKED_DEAD: The requested server has been marked dead.</p>
  410. */
  411. const RES_SERVER_MARKED_DEAD = 35;
  412. /**
  413. * <p>MEMCACHED_UNKNOWN_STAT_KEY: The server you are communicating with has a stat key which has not be defined in the protocol.</p>
  414. */
  415. const RES_UNKNOWN_STAT_KEY = 36;
  416. /**
  417. * <p>MEMCACHED_INVALID_HOST_PROTOCOL: The server you are connecting too has an invalid protocol. Most likely you are connecting to an older server that does not speak the binary protocol.</p>
  418. */
  419. const RES_INVALID_HOST_PROTOCOL = 34;
  420. /**
  421. * <p>MEMCACHED_MEMORY_ALLOCATION_FAILURE: An error has occurred while trying to allocate memory.</p>
  422. */
  423. const RES_MEMORY_ALLOCATION_FAILURE = 17;
  424. /**
  425. * <p>MEMCACHED_E2BIG: Item is too large for the server to store.</p>
  426. */
  427. const RES_E2BIG = 37;
  428. /**
  429. * <p>MEMCACHED_KEY_TOO_BIG: The key that has been provided is too large for the given server.</p>
  430. */
  431. const RES_KEY_TOO_BIG = 39;
  432. /**
  433. * <p>MEMCACHED_SERVER_TEMPORARILY_DISABLED</p>
  434. */
  435. const RES_SERVER_TEMPORARILY_DISABLED = 47;
  436. /**
  437. * <p>MEMORY_ALLOCATION_FAILURE: An error has occurred while trying to allocate memory.
  438. *
  439. * #if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000008</p>
  440. */
  441. const RES_SERVER_MEMORY_ALLOCATION_FAILURE = 48;
  442. /**
  443. * <p>MEMCACHED_AUTH_PROBLEM: An unknown issue has occured during authentication.</p>
  444. */
  445. const RES_AUTH_PROBLEM = 40;
  446. /**
  447. * <p>MEMCACHED_AUTH_FAILURE: The credentials provided are not valid for this server.</p>
  448. */
  449. const RES_AUTH_FAILURE = 41;
  450. /**
  451. * <p>MEMCACHED_AUTH_CONTINUE: Authentication has been paused.</p>
  452. */
  453. const RES_AUTH_CONTINUE = 42;
  454. /**
  455. * <p>MEMCACHED_CONNECTION_FAILURE: A unknown error has occured while trying to connect to a server.</p>
  456. */
  457. const RES_CONNECTION_FAILURE = 3;
  458. /**
  459. * <p>MEMCACHED_CONNECTION_BIND_FAILURE: Deprecated since version <0.30(libmemcached).
  460. * We were not able to bind() to the socket.</p>
  461. */
  462. const RES_CONNECTION_BIND_FAILURE = 4;
  463. /**
  464. * <p>MEMCACHED_READ_FAILURE: A read failure has occurred.</p>
  465. */
  466. const RES_READ_FAILURE = 6;
  467. /**
  468. * <p>MEMCACHED_DATA_DOES_NOT_EXIST: The data requested with the key given was not found.</p>
  469. */
  470. const RES_DATA_DOES_NOT_EXIST = 13;
  471. /**
  472. * <p>MEMCACHED_VALUE: A value has been returned from the server (this is an internal condition only).</p>
  473. */
  474. const RES_VALUE = 23;
  475. /**
  476. * <p>MEMCACHED_FAIL_UNIX_SOCKET: A connection was not established with the server via a unix domain socket.</p>
  477. */
  478. const RES_FAIL_UNIX_SOCKET = 27;
  479. /**
  480. * <p>MEMCACHED_NO_KEY_PROVIDED: Deprecated since version <0.30(libmemcached): Use MEMCACHED_BAD_KEY_PROVIDED instead.
  481. * No key was provided.</p>
  482. */
  483. const RES_NO_KEY_PROVIDED = 29;
  484. /**
  485. * <p>MEMCACHED_INVALID_ARGUMENTS: The arguments supplied to the given function were not valid.</p>
  486. */
  487. const RES_INVALID_ARGUMENTS = 38;
  488. /**
  489. * <p>MEMCACHED_PARSE_ERROR: An error has occurred while trying to parse the configuration string. You should use memparse to determine what the error was.</p>
  490. */
  491. const RES_PARSE_ERROR = 43;
  492. /**
  493. * <p>MEMCACHED_PARSE_USER_ERROR: An error has occurred in parsing the configuration string.</p>
  494. */
  495. const RES_PARSE_USER_ERROR = 44;
  496. /**
  497. * <p>MEMCACHED_DEPRECATED: The method that was requested has been deprecated.</p>
  498. */
  499. const RES_DEPRECATED = 45;
  500. //unknow
  501. const RES_IN_PROGRESS = 46;
  502. /**
  503. * <p>MEMCACHED_MAXIMUM_RETURN: This in an internal only state.</p>
  504. */
  505. const RES_MAXIMUM_RETURN = 49;
  506. /**
  507. * Server callbacks, if compiled with --memcached-protocol
  508. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/memcached-api.php
  509. */
  510. const ON_CONNECT = 0;
  511. const ON_ADD = 1;
  512. const ON_APPEND = 2;
  513. const ON_DECREMENT = 3;
  514. const ON_DELETE = 4;
  515. const ON_FLUSH = 5;
  516. const ON_GET = 6;
  517. const ON_INCREMENT = 7;
  518. const ON_NOOP = 8;
  519. const ON_PREPEND = 9;
  520. const ON_QUIT = 10;
  521. const ON_REPLACE = 11;
  522. const ON_SET = 12;
  523. const ON_STAT = 13;
  524. const ON_VERSION = 14;
  525. /**
  526. * Constants used when compiled with --memcached-protocol
  527. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/memcached-api.php
  528. */
  529. const RESPONSE_SUCCESS = 0;
  530. const RESPONSE_KEY_ENOENT = 1;
  531. const RESPONSE_KEY_EEXISTS = 2;
  532. const RESPONSE_E2BIG = 3;
  533. const RESPONSE_EINVAL = 4;
  534. const RESPONSE_NOT_STORED = 5;
  535. const RESPONSE_DELTA_BADVAL = 6;
  536. const RESPONSE_NOT_MY_VBUCKET = 7;
  537. const RESPONSE_AUTH_ERROR = 32;
  538. const RESPONSE_AUTH_CONTINUE = 33;
  539. const RESPONSE_UNKNOWN_COMMAND = 129;
  540. const RESPONSE_ENOMEM = 130;
  541. const RESPONSE_NOT_SUPPORTED = 131;
  542. const RESPONSE_EINTERNAL = 132;
  543. const RESPONSE_EBUSY = 133;
  544. const RESPONSE_ETMPFAIL = 134;
  545. /**
  546. * <p>Failed to create network socket.</p>
  547. * @link https://php.net/manual/en/memcached.constants.php
  548. */
  549. const RES_CONNECTION_SOCKET_CREATE_FAILURE = 11;
  550. /**
  551. * <p>Payload failure: could not compress/decompress or serialize/unserialize the value.</p>
  552. * @link https://php.net/manual/en/memcached.constants.php
  553. */
  554. const RES_PAYLOAD_FAILURE = -1001;
  555. /**
  556. * <p>The default PHP serializer.</p>
  557. * @link https://php.net/manual/en/memcached.constants.php
  558. */
  559. const SERIALIZER_PHP = 1;
  560. /**
  561. * <p>The igbinary serializer.
  562. * Instead of textual representation it stores PHP data structures in a
  563. * compact binary form, resulting in space and time gains.</p>
  564. * @link https://php.net/manual/en/memcached.constants.php
  565. */
  566. const SERIALIZER_IGBINARY = 2;
  567. /**
  568. * <p>The JSON serializer. Requires PHP 5.2.10+.</p>
  569. * @link https://php.net/manual/en/memcached.constants.php
  570. */
  571. const SERIALIZER_JSON = 3;
  572. const SERIALIZER_JSON_ARRAY = 4;
  573. /**
  574. * <p>The msgpack serializer.</p>
  575. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/memcached-api.php
  576. */
  577. const SERIALIZER_MSGPACK = 5;
  578. const COMPRESSION_FASTLZ = 2;
  579. const COMPRESSION_ZLIB = 1;
  580. /**
  581. * <p>A flag for <b>Memcached::getMulti</b> and
  582. * <b>Memcached::getMultiByKey</b> to ensure that the keys are
  583. * returned in the same order as they were requested in. Non-existing keys
  584. * get a default value of NULL.</p>
  585. * @link https://php.net/manual/en/memcached.constants.php
  586. */
  587. const GET_PRESERVE_ORDER = 1;
  588. /**
  589. * A flag for <b>Memcached::get()</b>, <b>Memcached::getMulti()</b> and
  590. * <b>Memcached::getMultiByKey()</b> to ensure that the CAS token values are returned as well.
  591. * @link https://php.net/manual/en/memcached.constants.php
  592. */
  593. const GET_EXTENDED = 2;
  594. const GET_ERROR_RETURN_VALUE = false;
  595. /**
  596. * (PECL memcached &gt;= 0.1.0)<br/>
  597. * Create a Memcached instance
  598. * @link https://php.net/manual/en/memcached.construct.php, https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  599. * @param string $persistent_id [optional]
  600. * @param callable $on_new_object_cb [optional]
  601. * @param string $connection_str [optional]
  602. */
  603. public function __construct ($persistent_id = '', $on_new_object_cb = null, $connection_str = '') {}
  604. /**
  605. * (PECL memcached &gt;= 0.1.0)<br/>
  606. * Return the result code of the last operation
  607. * @link https://php.net/manual/en/memcached.getresultcode.php
  608. * @return int Result code of the last Memcached operation.
  609. */
  610. public function getResultCode () {}
  611. /**
  612. * (PECL memcached &gt;= 1.0.0)<br/>
  613. * Return the message describing the result of the last operation
  614. * @link https://php.net/manual/en/memcached.getresultmessage.php
  615. * @return string Message describing the result of the last Memcached operation.
  616. */
  617. public function getResultMessage () {}
  618. /**
  619. * (PECL memcached &gt;= 0.1.0)<br/>
  620. * Retrieve an item
  621. * @link https://php.net/manual/en/memcached.get.php
  622. * @param string $key <p>
  623. * The key of the item to retrieve.
  624. * </p>
  625. * @param callable $cache_cb [optional] <p>
  626. * Read-through caching callback or <b>NULL</b>.
  627. * </p>
  628. * @param int $flags [optional] <p>
  629. * The flags for the get operation.
  630. * </p>
  631. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  632. * The <b>Memcached::getResultCode</b> will return
  633. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  634. */
  635. public function get ($key, callable $cache_cb = null, $flags = 0) {}
  636. /**
  637. * (PECL memcached &gt;= 0.1.0)<br/>
  638. * Retrieve an item from a specific server
  639. * @link https://php.net/manual/en/memcached.getbykey.php
  640. * @param string $server_key <p>
  641. * 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.
  642. * </p>
  643. * @param string $key <p>
  644. * The key of the item to fetch.
  645. * </p>
  646. * @param callable $cache_cb [optional] <p>
  647. * Read-through caching callback or <b>NULL</b>
  648. * </p>
  649. * @param int $flags [optional] <p>
  650. * The flags for the get operation.
  651. * </p>
  652. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  653. * The <b>Memcached::getResultCode</b> will return
  654. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  655. */
  656. public function getByKey ($server_key, $key, callable $cache_cb = null, $flags = 0) {}
  657. /**
  658. * (PECL memcached &gt;= 0.1.0)<br/>
  659. * Retrieve multiple items
  660. * @link https://php.net/manual/en/memcached.getmulti.php
  661. * @param array $keys <p>
  662. * Array of keys to retrieve.
  663. * </p>
  664. * @param int $flags [optional] <p>
  665. * The flags for the get operation.
  666. * </p>
  667. * @return mixed the array of found items or <b>FALSE</b> on failure.
  668. * Use <b>Memcached::getResultCode</b> if necessary.
  669. */
  670. public function getMulti (array $keys, $flags = 0) {}
  671. /**
  672. * (PECL memcached &gt;= 0.1.0)<br/>
  673. * Retrieve multiple items from a specific server
  674. * @link https://php.net/manual/en/memcached.getmultibykey.php
  675. * @param string $server_key <p>
  676. * 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.
  677. * </p>
  678. * @param array $keys <p>
  679. * Array of keys to retrieve.
  680. * </p>
  681. * @param int $flags [optional] <p>
  682. * The flags for the get operation.
  683. * </p>
  684. * @return array|false the array of found items or <b>FALSE</b> on failure.
  685. * Use <b>Memcached::getResultCode</b> if necessary.
  686. */
  687. public function getMultiByKey ($server_key, array $keys, $flags = 0) {}
  688. /**
  689. * (PECL memcached &gt;= 0.1.0)<br/>
  690. * Request multiple items
  691. * @link https://php.net/manual/en/memcached.getdelayed.php
  692. * @param array $keys <p>
  693. * Array of keys to request.
  694. * </p>
  695. * @param bool $with_cas [optional] <p>
  696. * Whether to request CAS token values also.
  697. * </p>
  698. * @param callable $value_cb [optional] <p>
  699. * The result callback or <b>NULL</b>.
  700. * </p>
  701. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  702. * Use <b>Memcached::getResultCode</b> if necessary.
  703. */
  704. public function getDelayed (array $keys, $with_cas = null, callable $value_cb = null) {}
  705. /**
  706. * (PECL memcached &gt;= 0.1.0)<br/>
  707. * Request multiple items from a specific server
  708. * @link https://php.net/manual/en/memcached.getdelayedbykey.php
  709. * @param string $server_key <p>
  710. * 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.
  711. * </p>
  712. * @param array $keys <p>
  713. * Array of keys to request.
  714. * </p>
  715. * @param bool $with_cas [optional] <p>
  716. * Whether to request CAS token values also.
  717. * </p>
  718. * @param callable $value_cb [optional] <p>
  719. * The result callback or <b>NULL</b>.
  720. * </p>
  721. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  722. * Use <b>Memcached::getResultCode</b> if necessary.
  723. */
  724. public function getDelayedByKey ($server_key, array $keys, $with_cas = null, callable $value_cb = null) {}
  725. /**
  726. * (PECL memcached &gt;= 0.1.0)<br/>
  727. * Fetch the next result
  728. * @link https://php.net/manual/en/memcached.fetch.php
  729. * @return array|false the next result or <b>FALSE</b> otherwise.
  730. * The <b>Memcached::getResultCode</b> will return
  731. * <b>Memcached::RES_END</b> if result set is exhausted.
  732. */
  733. public function fetch () {}
  734. /**
  735. * (PECL memcached &gt;= 0.1.0)<br/>
  736. * Fetch all the remaining results
  737. * @link https://php.net/manual/en/memcached.fetchall.php
  738. * @return array|false the results or <b>FALSE</b> on failure.
  739. * Use <b>Memcached::getResultCode</b> if necessary.
  740. */
  741. public function fetchAll () {}
  742. /**
  743. * (PECL memcached &gt;= 0.1.0)<br/>
  744. * Store an item
  745. * @link https://php.net/manual/en/memcached.set.php
  746. * @param string $key <p>
  747. * The key under which to store the value.
  748. * </p>
  749. * @param mixed $value <p>
  750. * The value to store.
  751. * </p>
  752. * @param int $expiration [optional] <p>
  753. * The expiration time, defaults to 0. See Expiration Times for more info.
  754. * </p>
  755. * @param int $udf_flags [optional]
  756. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  757. * Use <b>Memcached::getResultCode</b> if necessary.
  758. */
  759. public function set ($key, $value, $expiration = 0, $udf_flags = 0) {}
  760. /**
  761. * (PECL memcached &gt;= 0.1.0)<br/>
  762. * Store an item on a specific server
  763. * @link https://php.net/manual/en/memcached.setbykey.php
  764. * @param string $server_key <p>
  765. * 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.
  766. * </p>
  767. * @param string $key <p>
  768. * The key under which to store the value.
  769. * </p>
  770. * @param mixed $value <p>
  771. * The value to store.
  772. * </p>
  773. * @param int $expiration [optional] <p>
  774. * The expiration time, defaults to 0. See Expiration Times for more info.
  775. * </p>
  776. * @param int $udf_flags [optional]
  777. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  778. * Use <b>Memcached::getResultCode</b> if necessary.
  779. */
  780. public function setByKey ($server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  781. /**
  782. * (PECL memcached &gt;= 2.0.0)<br/>
  783. * Set a new expiration on an item
  784. * @link https://php.net/manual/en/memcached.touch.php
  785. * @param string $key <p>
  786. * The key under which to store the value.
  787. * </p>
  788. * @param int $expiration <p>
  789. * The expiration time, defaults to 0. See Expiration Times for more info.
  790. * </p>
  791. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  792. * Use <b>Memcached::getResultCode</b> if necessary.
  793. */
  794. public function touch ($key, $expiration = 0) {}
  795. /**
  796. * (PECL memcached &gt;= 2.0.0)<br/>
  797. * Set a new expiration on an item on a specific server
  798. * @link https://php.net/manual/en/memcached.touchbykey.php
  799. * @param string $server_key <p>
  800. * 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.
  801. * </p>
  802. * @param string $key <p>
  803. * The key under which to store the value.
  804. * </p>
  805. * @param int $expiration <p>
  806. * The expiration time, defaults to 0. See Expiration Times for more info.
  807. * </p>
  808. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  809. * Use <b>Memcached::getResultCode</b> if necessary.
  810. */
  811. public function touchByKey ($server_key, $key, $expiration) {}
  812. /**
  813. * (PECL memcached &gt;= 0.1.0)<br/>
  814. * Store multiple items
  815. * @link https://php.net/manual/en/memcached.setmulti.php
  816. * @param array $items <p>
  817. * An array of key/value pairs to store on the server.
  818. * </p>
  819. * @param int $expiration [optional] <p>
  820. * The expiration time, defaults to 0. See Expiration Times for more info.
  821. * </p>
  822. * @param int $udf_flags [optional]
  823. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  824. * Use <b>Memcached::getResultCode</b> if necessary.
  825. */
  826. public function setMulti (array $items, $expiration = 0, $udf_flags = 0) {}
  827. /**
  828. * (PECL memcached &gt;= 0.1.0)<br/>
  829. * Store multiple items on a specific server
  830. * @link https://php.net/manual/en/memcached.setmultibykey.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 array $items <p>
  835. * An array of key/value pairs to store on the server.
  836. * </p>
  837. * @param int $expiration [optional] <p>
  838. * The expiration time, defaults to 0. See Expiration Times for more info.
  839. * </p>
  840. * @param int $udf_flags [optional]
  841. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  842. * Use <b>Memcached::getResultCode</b> if necessary.
  843. */
  844. public function setMultiByKey ($server_key, array $items, $expiration = 0, $udf_flags = 0) {}
  845. /**
  846. * (PECL memcached &gt;= 0.1.0)<br/>
  847. * Compare and swap an item
  848. * @link https://php.net/manual/en/memcached.cas.php
  849. * @param float $cas_token <p>
  850. * Unique value associated with the existing item. Generated by memcache.
  851. * </p>
  852. * @param string $key <p>
  853. * The key under which to store the value.
  854. * </p>
  855. * @param mixed $value <p>
  856. * The value to store.
  857. * </p>
  858. * @param int $expiration [optional] <p>
  859. * The expiration time, defaults to 0. See Expiration Times for more info.
  860. * </p>
  861. * @param int $udf_flags [optional]
  862. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  863. * The <b>Memcached::getResultCode</b> will return
  864. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  865. * to store has been modified since you last fetched it.
  866. */
  867. public function cas ($cas_token, $key, $value, $expiration = 0, $udf_flags = 0) {}
  868. /**
  869. * (PECL memcached &gt;= 0.1.0)<br/>
  870. * Compare and swap an item on a specific server
  871. * @link https://php.net/manual/en/memcached.casbykey.php
  872. * @param float $cas_token <p>
  873. * Unique value associated with the existing item. Generated by memcache.
  874. * </p>
  875. * @param string $server_key <p>
  876. * 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.
  877. * </p>
  878. * @param string $key <p>
  879. * The key under which to store the value.
  880. * </p>
  881. * @param mixed $value <p>
  882. * The value to store.
  883. * </p>
  884. * @param int $expiration [optional] <p>
  885. * The expiration time, defaults to 0. See Expiration Times for more info.
  886. * </p>
  887. * @param int $udf_flags [optional]
  888. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  889. * The <b>Memcached::getResultCode</b> will return
  890. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  891. * to store has been modified since you last fetched it.
  892. */
  893. public function casByKey ($cas_token, $server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  894. /**
  895. * (PECL memcached &gt;= 0.1.0)<br/>
  896. * Add an item under a new key
  897. * @link https://php.net/manual/en/memcached.add.php
  898. * @param string $key <p>
  899. * The key under which to store the value.
  900. * </p>
  901. * @param mixed $value <p>
  902. * The value to store.
  903. * </p>
  904. * @param int $expiration [optional] <p>
  905. * The expiration time, defaults to 0. See Expiration Times for more info.
  906. * </p>
  907. * @param int $udf_flags [optional]
  908. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  909. * The <b>Memcached::getResultCode</b> will return
  910. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  911. */
  912. public function add ($key, $value, $expiration = 0, $udf_flags = 0) {}
  913. /**
  914. * (PECL memcached &gt;= 0.1.0)<br/>
  915. * Add an item under a new key on a specific server
  916. * @link https://php.net/manual/en/memcached.addbykey.php
  917. * @param string $server_key <p>
  918. * 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.
  919. * </p>
  920. * @param string $key <p>
  921. * The key under which to store the value.
  922. * </p>
  923. * @param mixed $value <p>
  924. * The value to store.
  925. * </p>
  926. * @param int $expiration [optional] <p>
  927. * The expiration time, defaults to 0. See Expiration Times for more info.
  928. * </p>
  929. * @param int $udf_flags [optional]
  930. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  931. * The <b>Memcached::getResultCode</b> will return
  932. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  933. */
  934. public function addByKey ($server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  935. /**
  936. * (PECL memcached &gt;= 0.1.0)<br/>
  937. * Append data to an existing item
  938. * @link https://php.net/manual/en/memcached.append.php
  939. * @param string $key <p>
  940. * The key under which to store the value.
  941. * </p>
  942. * @param string $value <p>
  943. * The string to append.
  944. * </p>
  945. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  946. * The <b>Memcached::getResultCode</b> will return
  947. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  948. */
  949. public function append ($key, $value) {}
  950. /**
  951. * (PECL memcached &gt;= 0.1.0)<br/>
  952. * Append data to an existing item on a specific server
  953. * @link https://php.net/manual/en/memcached.appendbykey.php
  954. * @param string $server_key <p>
  955. * 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.
  956. * </p>
  957. * @param string $key <p>
  958. * The key under which to store the value.
  959. * </p>
  960. * @param string $value <p>
  961. * The string to append.
  962. * </p>
  963. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  964. * The <b>Memcached::getResultCode</b> will return
  965. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  966. */
  967. public function appendByKey ($server_key, $key, $value) {}
  968. /**
  969. * (PECL memcached &gt;= 0.1.0)<br/>
  970. * Prepend data to an existing item
  971. * @link https://php.net/manual/en/memcached.prepend.php
  972. * @param string $key <p>
  973. * The key of the item to prepend the data to.
  974. * </p>
  975. * @param string $value <p>
  976. * The string to prepend.
  977. * </p>
  978. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  979. * The <b>Memcached::getResultCode</b> will return
  980. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  981. */
  982. public function prepend ($key, $value) {}
  983. /**
  984. * (PECL memcached &gt;= 0.1.0)<br/>
  985. * Prepend data to an existing item on a specific server
  986. * @link https://php.net/manual/en/memcached.prependbykey.php
  987. * @param string $server_key <p>
  988. * 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.
  989. * </p>
  990. * @param string $key <p>
  991. * The key of the item to prepend the data to.
  992. * </p>
  993. * @param string $value <p>
  994. * The string to prepend.
  995. * </p>
  996. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  997. * The <b>Memcached::getResultCode</b> will return
  998. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  999. */
  1000. public function prependByKey ($server_key, $key, $value) {}
  1001. /**
  1002. * (PECL memcached &gt;= 0.1.0)<br/>
  1003. * Replace the item under an existing key
  1004. * @link https://php.net/manual/en/memcached.replace.php
  1005. * @param string $key <p>
  1006. * The key under which to store the value.
  1007. * </p>
  1008. * @param mixed $value <p>
  1009. * The value to store.
  1010. * </p>
  1011. * @param int $expiration [optional] <p>
  1012. * The expiration time, defaults to 0. See Expiration Times for more info.
  1013. * </p>
  1014. * @param int $udf_flags [optional]
  1015. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1016. * The <b>Memcached::getResultCode</b> will return
  1017. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  1018. */
  1019. public function replace ($key, $value, $expiration = null, $udf_flags = 0) {}
  1020. /**
  1021. * (PECL memcached &gt;= 0.1.0)<br/>
  1022. * Replace the item under an existing key on a specific server
  1023. * @link https://php.net/manual/en/memcached.replacebykey.php
  1024. * @param string $server_key <p>
  1025. * 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.
  1026. * </p>
  1027. * @param string $key <p>
  1028. * The key under which to store the value.
  1029. * </p>
  1030. * @param mixed $value <p>
  1031. * The value to store.
  1032. * </p>
  1033. * @param int $expiration [optional] <p>
  1034. * The expiration time, defaults to 0. See Expiration Times for more info.
  1035. * </p>
  1036. * @param int $udf_flags [optional]
  1037. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1038. * The <b>Memcached::getResultCode</b> will return
  1039. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  1040. */
  1041. public function replaceByKey ($server_key, $key, $value, $expiration = null, $udf_flags = 0) {}
  1042. /**
  1043. * (PECL memcached &gt;= 0.1.0)<br/>
  1044. * Delete an item
  1045. * @link https://php.net/manual/en/memcached.delete.php
  1046. * @param string $key <p>
  1047. * The key to be deleted.
  1048. * </p>
  1049. * @param int $time [optional] <p>
  1050. * The amount of time the server will wait to delete the item.
  1051. * </p>
  1052. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1053. * The <b>Memcached::getResultCode</b> will return
  1054. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  1055. */
  1056. public function delete ($key, $time = 0) {}
  1057. /**
  1058. * (PECL memcached &gt;= 2.0.0)<br/>
  1059. * Delete multiple items
  1060. * @link https://php.net/manual/en/memcached.deletemulti.php
  1061. * @param array $keys <p>
  1062. * The keys to be deleted.
  1063. * </p>
  1064. * @param int $time [optional] <p>
  1065. * The amount of time the server will wait to delete the items.
  1066. * </p>
  1067. * @return array Returns array indexed by keys and where values are indicating whether operation succeeded or not.
  1068. * The <b>Memcached::getResultCode</b> will return
  1069. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  1070. */
  1071. public function deleteMulti (array $keys, $time = 0) {}
  1072. /**
  1073. * (PECL memcached &gt;= 0.1.0)<br/>
  1074. * Delete an item from a specific server
  1075. * @link https://php.net/manual/en/memcached.deletebykey.php
  1076. * @param string $server_key <p>
  1077. * 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.
  1078. * </p>
  1079. * @param string $key <p>
  1080. * The key to be deleted.
  1081. * </p>
  1082. * @param int $time [optional] <p>
  1083. * The amount of time the server will wait to delete the item.
  1084. * </p>
  1085. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1086. * The <b>Memcached::getResultCode</b> will return
  1087. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  1088. */
  1089. public function deleteByKey ($server_key, $key, $time = 0) {}
  1090. /**
  1091. * (PECL memcached &gt;= 2.0.0)<br/>
  1092. * Delete multiple items from a specific server
  1093. * @link https://php.net/manual/en/memcached.deletemultibykey.php
  1094. * @param string $server_key <p>
  1095. * 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.
  1096. * </p>
  1097. * @param array $keys <p>
  1098. * The keys to be deleted.
  1099. * </p>
  1100. * @param int $time [optional] <p>
  1101. * The amount of time the server will wait to delete the items.
  1102. * </p>
  1103. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1104. * The <b>Memcached::getResultCode</b> will return
  1105. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  1106. */
  1107. public function deleteMultiByKey ($server_key, array $keys, $time = 0) {}
  1108. /**
  1109. * (PECL memcached &gt;= 0.1.0)<br/>
  1110. * Increment numeric item's value
  1111. * @link https://php.net/manual/en/memcached.increment.php
  1112. * @param string $key <p>
  1113. * The key of the item to increment.
  1114. * </p>
  1115. * @param int $offset [optional] <p>
  1116. * The amount by which to increment the item's value.
  1117. * </p>
  1118. * @param int $initial_value [optional] <p>
  1119. * The value to set the item to if it doesn't currently exist.
  1120. * </p>
  1121. * @param int $expiry [optional] <p>
  1122. * The expiry time to set on the item.
  1123. * </p>
  1124. * @return int|false new item's value on success or <b>FALSE</b> on failure.
  1125. */
  1126. public function increment ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  1127. /**
  1128. * (PECL memcached &gt;= 0.1.0)<br/>
  1129. * Decrement numeric item's value
  1130. * @link https://php.net/manual/en/memcached.decrement.php
  1131. * @param string $key <p>
  1132. * The key of the item to decrement.
  1133. * </p>
  1134. * @param int $offset [optional] <p>
  1135. * The amount by which to decrement the item's value.
  1136. * </p>
  1137. * @param int $initial_value [optional] <p>
  1138. * The value to set the item to if it doesn't currently exist.
  1139. * </p>
  1140. * @param int $expiry [optional] <p>
  1141. * The expiry time to set on the item.
  1142. * </p>
  1143. * @return int|false item's new value on success or <b>FALSE</b> on failure.
  1144. */
  1145. public function decrement ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  1146. /**
  1147. * (PECL memcached &gt;= 2.0.0)<br/>
  1148. * Increment numeric item's value, stored on a specific server
  1149. * @link https://php.net/manual/en/memcached.incrementbykey.php
  1150. * @param string $server_key <p>
  1151. * 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.
  1152. * </p>
  1153. * @param string $key <p>
  1154. * The key of the item to increment.
  1155. * </p>
  1156. * @param int $offset [optional] <p>
  1157. * The amount by which to increment the item's value.
  1158. * </p>
  1159. * @param int $initial_value [optional] <p>
  1160. * The value to set the item to if it doesn't currently exist.
  1161. * </p>
  1162. * @param int $expiry [optional] <p>
  1163. * The expiry time to set on the item.
  1164. * </p>
  1165. * @return int|false new item's value on success or <b>FALSE</b> on failure.
  1166. */
  1167. public function incrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  1168. /**
  1169. * (PECL memcached &gt;= 2.0.0)<br/>
  1170. * Decrement numeric item's value, stored on a specific server
  1171. * @link https://php.net/manual/en/memcached.decrementbykey.php
  1172. * @param string $server_key <p>
  1173. * 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.
  1174. * </p>
  1175. * @param string $key <p>
  1176. * The key of the item to decrement.
  1177. * </p>
  1178. * @param int $offset [optional] <p>
  1179. * The amount by which to decrement the item's value.
  1180. * </p>
  1181. * @param int $initial_value [optional] <p>
  1182. * The value to set the item to if it doesn't currently exist.
  1183. * </p>
  1184. * @param int $expiry [optional] <p>
  1185. * The expiry time to set on the item.
  1186. * </p>
  1187. * @return int|false item's new value on success or <b>FALSE</b> on failure.
  1188. */
  1189. public function decrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  1190. /**
  1191. * (PECL memcached &gt;= 0.1.0)<br/>
  1192. * Add a server to the server pool
  1193. * @link https://php.net/manual/en/memcached.addserver.php
  1194. * @param string $host <p>
  1195. * The hostname of the memcache server. If the hostname is invalid, data-related
  1196. * operations will set
  1197. * <b>Memcached::RES_HOST_LOOKUP_FAILURE</b> result code.
  1198. * </p>
  1199. * @param int $port <p>
  1200. * The port on which memcache is running. Usually, this is
  1201. * 11211.
  1202. * </p>
  1203. * @param int $weight [optional] <p>
  1204. * The weight of the server relative to the total weight of all the
  1205. * servers in the pool. This controls the probability of the server being
  1206. * selected for operations. This is used only with consistent distribution
  1207. * option and usually corresponds to the amount of memory available to
  1208. * memcache on that server.
  1209. * </p>
  1210. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1211. */
  1212. public function addServer ($host, $port, $weight = 0) {}
  1213. /**
  1214. * (PECL memcached &gt;= 0.1.1)<br/>
  1215. * Add multiple servers to the server pool
  1216. * @link https://php.net/manual/en/memcached.addservers.php
  1217. * @param array $servers
  1218. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1219. */
  1220. public function addServers (array $servers) {}
  1221. /**
  1222. * (PECL memcached &gt;= 0.1.0)<br/>
  1223. * Get the list of the servers in the pool
  1224. * @link https://php.net/manual/en/memcached.getserverlist.php
  1225. * @return array The list of all servers in the server pool.
  1226. */
  1227. public function getServerList () {}
  1228. /**
  1229. * (PECL memcached &gt;= 0.1.0)<br/>
  1230. * Map a key to a server
  1231. * @link https://php.net/manual/en/memcached.getserverbykey.php
  1232. * @param string $server_key <p>
  1233. * 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.
  1234. * </p>
  1235. * @return array an array containing three keys of host,
  1236. * port, and weight on success or <b>FALSE</b>
  1237. * on failure.
  1238. * Use <b>Memcached::getResultCode</b> if necessary.
  1239. */
  1240. public function getServerByKey ($server_key) {}
  1241. /**
  1242. * (PECL memcached &gt;= 2.0.0)<br/>
  1243. * Clears all servers from the server list
  1244. * @link https://php.net/manual/en/memcached.resetserverlist.php
  1245. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1246. */
  1247. public function resetServerList () {}
  1248. /**
  1249. * (PECL memcached &gt;= 2.0.0)<br/>
  1250. * Close any open connections
  1251. * @link https://php.net/manual/en/memcached.quit.php
  1252. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1253. */
  1254. public function quit () {}
  1255. /**
  1256. * (PECL memcached &gt;= 0.1.0)<br/>
  1257. * Get server pool statistics
  1258. * @link https://php.net/manual/en/memcached.getstats.php
  1259. * @param string $type <p>items, slabs, sizes ...</p>
  1260. * @return array Array of server statistics, one entry per server.
  1261. */
  1262. public function getStats ($type = null) {}
  1263. /**
  1264. * (PECL memcached &gt;= 0.1.5)<br/>
  1265. * Get server pool version info
  1266. * @link https://php.net/manual/en/memcached.getversion.php
  1267. * @return array Array of server versions, one entry per server.
  1268. */
  1269. public function getVersion () {}
  1270. /**
  1271. * (PECL memcached &gt;= 2.0.0)<br/>
  1272. * Gets the keys stored on all the servers
  1273. * @link https://php.net/manual/en/memcached.getallkeys.php
  1274. * @return array|false the keys stored on all the servers on success or <b>FALSE</b> on failure.
  1275. */
  1276. public function getAllKeys () {}
  1277. /**
  1278. * (PECL memcached &gt;= 0.1.0)<br/>
  1279. * Invalidate all items in the cache
  1280. * @link https://php.net/manual/en/memcached.flush.php
  1281. * @param int $delay [optional] <p>
  1282. * Numer of seconds to wait before invalidating the items.
  1283. * </p>
  1284. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1285. * Use <b>Memcached::getResultCode</b> if necessary.
  1286. */
  1287. public function flush ($delay = 0) {}
  1288. /**
  1289. * (PECL memcached &gt;= 0.1.0)<br/>
  1290. * Retrieve a Memcached option value
  1291. * @link https://php.net/manual/en/memcached.getoption.php
  1292. * @param int $option <p>
  1293. * One of the Memcached::OPT_* constants.
  1294. * </p>
  1295. * @return mixed the value of the requested option, or <b>FALSE</b> on
  1296. * error.
  1297. */
  1298. public function getOption ($option) {}
  1299. /**
  1300. * (PECL memcached &gt;= 0.1.0)<br/>
  1301. * Set a Memcached option
  1302. * @link https://php.net/manual/en/memcached.setoption.php
  1303. * @param int $option
  1304. * @param mixed $value
  1305. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1306. */
  1307. public function setOption ($option, $value) {}
  1308. /**
  1309. * (PECL memcached &gt;= 2.0.0)<br/>
  1310. * Set Memcached options
  1311. * @link https://php.net/manual/en/memcached.setoptions.php
  1312. * @param array $options <p>
  1313. * An associative array of options where the key is the option to set and
  1314. * the value is the new value for the option.
  1315. * </p>
  1316. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1317. */
  1318. public function setOptions (array $options) {}
  1319. /**
  1320. * (PECL memcached &gt;= 2.0.0)<br/>
  1321. * Set the credentials to use for authentication
  1322. * @link https://www.php.net/manual/en/memcached.setsaslauthdata.php
  1323. * @param string $username <p>
  1324. * The username to use for authentication.
  1325. * </p>
  1326. * @param string $password <p>
  1327. * The password to use for authentication.
  1328. * </p>
  1329. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1330. */
  1331. public function setSaslAuthData (string $username , string $password) {}
  1332. /**
  1333. * (PECL memcached &gt;= 2.0.0)<br/>
  1334. * Check if a persitent connection to memcache is being used
  1335. * @link https://php.net/manual/en/memcached.ispersistent.php
  1336. * @return bool true if Memcache instance uses a persistent connection, false otherwise.
  1337. */
  1338. public function isPersistent () {}
  1339. /**
  1340. * (PECL memcached &gt;= 2.0.0)<br/>
  1341. * Check if the instance was recently created
  1342. * @link https://php.net/manual/en/memcached.ispristine.php
  1343. * @return bool the true if instance is recently created, false otherwise.
  1344. */
  1345. public function isPristine () {}
  1346. /**
  1347. * Flush and send buffered commands
  1348. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1349. * @return bool
  1350. */
  1351. public function flushBuffers () {}
  1352. /**
  1353. * Sets AES encryption key (libmemcached 1.0.6 and higher)
  1354. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1355. * @param string $key
  1356. * @return bool
  1357. */
  1358. public function setEncodingKey ( $key ) {}
  1359. /**
  1360. * Returns the last disconnected server. Was added in 0.34 according to libmemcached's Changelog
  1361. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1362. * @return array|false
  1363. */
  1364. public function getLastDisconnectedServer () {}
  1365. /**
  1366. * Returns the last error errno that occurred
  1367. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1368. * @return int
  1369. */
  1370. public function getLastErrorErrno () {}
  1371. /**
  1372. * Returns the last error code that occurred
  1373. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1374. * @return int
  1375. */
  1376. public function getLastErrorCode () {}
  1377. /**
  1378. * Returns the last error message that occurred
  1379. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1380. * @return string
  1381. */
  1382. public function getLastErrorMessage () {}
  1383. /**
  1384. * Sets the memcached virtual buckets
  1385. * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c
  1386. * @param array $host_map
  1387. * @param array $forward_map
  1388. * @param int $replicas
  1389. * @return bool
  1390. */
  1391. public function setBucket (array $host_map, array $forward_map, $replicas) {}
  1392. }
  1393. /**
  1394. * @link https://php.net/manual/en/class.memcachedexception.php
  1395. */
  1396. class MemcachedException extends RuntimeException {
  1397. function __construct( $errmsg = "", $errcode = 0 ) {}
  1398. }
  1399. // End of memcached v.3.1.5
  1400. ?>