memcached.phan_php 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. <?php
  2. // Start of memcached v.3.0.4
  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. 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 https://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 https://php.net/manual/en/memcached.constants.php
  67. */
  68. const HASH_DEFAULT = 0;
  69. /**
  70. * <p>MD5 item key hashing algorithm.</p>
  71. * @link https://php.net/manual/en/memcached.constants.php
  72. */
  73. const HASH_MD5 = 1;
  74. /**
  75. * <p>CRC item key hashing algorithm.</p>
  76. * @link https://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 https://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 https://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 https://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 https://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 https://php.net/manual/en/memcached.constants.php
  102. */
  103. const HASH_HSIEH = 7;
  104. /**
  105. * <p>Murmur item key hashing algorithm.</p>
  106. * @link https://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 https://php.net/manual/en/memcached.constants.php
  116. */
  117. const OPT_DISTRIBUTION = 9;
  118. /**
  119. * <p>Modulo-based key distribution algorithm.</p>
  120. * @link https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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 https://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_CORK = 31;
  251. const OPT_REMOVE_FAILED_SERVERS = 35;
  252. const OPT_DEAD_TIMEOUT = 36;
  253. const OPT_SERVER_TIMEOUT_LIMIT = 37;
  254. const OPT_MAX = 38;
  255. const OPT_IO_BYTES_WATERMARK = 23;
  256. const OPT_IO_KEY_PREFETCH = 24;
  257. const OPT_IO_MSG_WATERMARK = 22;
  258. const OPT_LOAD_FROM_FILE = 34;
  259. const OPT_SUPPORT_CAS = 7;
  260. const OPT_TCP_KEEPIDLE = 33;
  261. const OPT_USER_DATA = 11;
  262. /**
  263. * <p>The operation was successful.</p>
  264. * @link https://php.net/manual/en/memcached.constants.php
  265. */
  266. const RES_SUCCESS = 0;
  267. /**
  268. * <p>The operation failed in some fashion.</p>
  269. * @link https://php.net/manual/en/memcached.constants.php
  270. */
  271. const RES_FAILURE = 1;
  272. /**
  273. * <p>DNS lookup failed.</p>
  274. * @link https://php.net/manual/en/memcached.constants.php
  275. */
  276. const RES_HOST_LOOKUP_FAILURE = 2;
  277. /**
  278. * <p>Failed to read network data.</p>
  279. * @link https://php.net/manual/en/memcached.constants.php
  280. */
  281. const RES_UNKNOWN_READ_FAILURE = 7;
  282. /**
  283. * <p>Bad command in memcached protocol.</p>
  284. * @link https://php.net/manual/en/memcached.constants.php
  285. */
  286. const RES_PROTOCOL_ERROR = 8;
  287. /**
  288. * <p>Error on the client side.</p>
  289. * @link https://php.net/manual/en/memcached.constants.php
  290. */
  291. const RES_CLIENT_ERROR = 9;
  292. /**
  293. * <p>Error on the server side.</p>
  294. * @link https://php.net/manual/en/memcached.constants.php
  295. */
  296. const RES_SERVER_ERROR = 10;
  297. /**
  298. * <p>Failed to write network data.</p>
  299. * @link https://php.net/manual/en/memcached.constants.php
  300. */
  301. const RES_WRITE_FAILURE = 5;
  302. /**
  303. * <p>Failed to do compare-and-swap: item you are trying to store has been
  304. * modified since you last fetched it.</p>
  305. * @link https://php.net/manual/en/memcached.constants.php
  306. */
  307. const RES_DATA_EXISTS = 12;
  308. /**
  309. * <p>Item was not stored: but not because of an error. This normally
  310. * means that either the condition for an "add" or a "replace" command
  311. * wasn't met, or that the item is in a delete queue.</p>
  312. * @link https://php.net/manual/en/memcached.constants.php
  313. */
  314. const RES_NOTSTORED = 14;
  315. /**
  316. * <p>Item with this key was not found (with "get" operation or "cas"
  317. * operations).</p>
  318. * @link https://php.net/manual/en/memcached.constants.php
  319. */
  320. const RES_NOTFOUND = 16;
  321. /**
  322. * <p>Partial network data read error.</p>
  323. * @link https://php.net/manual/en/memcached.constants.php
  324. */
  325. const RES_PARTIAL_READ = 18;
  326. /**
  327. * <p>Some errors occurred during multi-get.</p>
  328. * @link https://php.net/manual/en/memcached.constants.php
  329. */
  330. const RES_SOME_ERRORS = 19;
  331. /**
  332. * <p>Server list is empty.</p>
  333. * @link https://php.net/manual/en/memcached.constants.php
  334. */
  335. const RES_NO_SERVERS = 20;
  336. /**
  337. * <p>End of result set.</p>
  338. * @link https://php.net/manual/en/memcached.constants.php
  339. */
  340. const RES_END = 21;
  341. /**
  342. * <p>System error.</p>
  343. * @link https://php.net/manual/en/memcached.constants.php
  344. */
  345. const RES_ERRNO = 26;
  346. /**
  347. * <p>The operation was buffered.</p>
  348. * @link https://php.net/manual/en/memcached.constants.php
  349. */
  350. const RES_BUFFERED = 32;
  351. /**
  352. * <p>The operation timed out.</p>
  353. * @link https://php.net/manual/en/memcached.constants.php
  354. */
  355. const RES_TIMEOUT = 31;
  356. /**
  357. * <p>Bad key.</p>
  358. * @link https://php.net/manual/en/memcached.constants.php
  359. */
  360. const RES_BAD_KEY_PROVIDED = 33;
  361. const RES_STORED = 15;
  362. const RES_DELETED = 22;
  363. const RES_STAT = 24;
  364. const RES_ITEM = 25;
  365. const RES_NOT_SUPPORTED = 28;
  366. const RES_FETCH_NOTFINISHED = 30;
  367. const RES_SERVER_MARKED_DEAD = 35;
  368. const RES_UNKNOWN_STAT_KEY = 36;
  369. const RES_INVALID_HOST_PROTOCOL = 34;
  370. const RES_MEMORY_ALLOCATION_FAILURE = 17;
  371. const RES_E2BIG = 37;
  372. const RES_KEY_TOO_BIG = 39;
  373. const RES_SERVER_TEMPORARILY_DISABLED = 47;
  374. const RES_SERVER_MEMORY_ALLOCATION_FAILURE = 48;
  375. const RES_AUTH_PROBLEM = 40;
  376. const RES_AUTH_FAILURE = 41;
  377. const RES_AUTH_CONTINUE = 42;
  378. const RES_CONNECTION_FAILURE = 3;
  379. const RES_CONNECTION_BIND_FAILURE = 4;
  380. const RES_READ_FAILURE = 6;
  381. const RES_DATA_DOES_NOT_EXIST = 13;
  382. const RES_VALUE = 23;
  383. const RES_FAIL_UNIX_SOCKET = 27;
  384. const RES_NO_KEY_PROVIDED = 29;
  385. const RES_INVALID_ARGUMENTS = 38;
  386. const RES_PARSE_ERROR = 43;
  387. const RES_PARSE_USER_ERROR = 44;
  388. const RES_DEPRECATED = 45;
  389. const RES_IN_PROGRESS = 46;
  390. const RES_MAXIMUM_RETURN = 49;
  391. /**
  392. * <p>Failed to create network socket.</p>
  393. * @link https://php.net/manual/en/memcached.constants.php
  394. */
  395. const RES_CONNECTION_SOCKET_CREATE_FAILURE = 11;
  396. /**
  397. * <p>Payload failure: could not compress/decompress or serialize/unserialize the value.</p>
  398. * @link https://php.net/manual/en/memcached.constants.php
  399. */
  400. const RES_PAYLOAD_FAILURE = -1001;
  401. /**
  402. * <p>The default PHP serializer.</p>
  403. * @link https://php.net/manual/en/memcached.constants.php
  404. */
  405. const SERIALIZER_PHP = 1;
  406. /**
  407. * <p>The igbinary serializer.
  408. * Instead of textual representation it stores PHP data structures in a
  409. * compact binary form, resulting in space and time gains.</p>
  410. * @link https://php.net/manual/en/memcached.constants.php
  411. */
  412. const SERIALIZER_IGBINARY = 2;
  413. /**
  414. * <p>The JSON serializer. Requires PHP 5.2.10+.</p>
  415. * @link https://php.net/manual/en/memcached.constants.php
  416. */
  417. const SERIALIZER_JSON = 3;
  418. const SERIALIZER_JSON_ARRAY = 4;
  419. const COMPRESSION_FASTLZ = 2;
  420. const COMPRESSION_ZLIB = 1;
  421. /**
  422. * <p>A flag for <b>Memcached::getMulti</b> and
  423. * <b>Memcached::getMultiByKey</b> to ensure that the keys are
  424. * returned in the same order as they were requested in. Non-existing keys
  425. * get a default value of NULL.</p>
  426. * @link https://php.net/manual/en/memcached.constants.php
  427. */
  428. const GET_PRESERVE_ORDER = 1;
  429. const GET_ERROR_RETURN_VALUE = false;
  430. /**
  431. * (PECL memcached &gt;= 0.1.0)<br/>
  432. * Create a Memcached instance
  433. * @link https://php.net/manual/en/memcached.construct.php
  434. * @param $persistent_id [optional]
  435. * @param $callback [optional]
  436. */
  437. public function __construct ($persistent_id = '', $on_new_object_cb = null) {}
  438. /**
  439. * (PECL memcached &gt;= 0.1.0)<br/>
  440. * Return the result code of the last operation
  441. * @link https://php.net/manual/en/memcached.getresultcode.php
  442. * @return int Result code of the last Memcached operation.
  443. */
  444. public function getResultCode () {}
  445. /**
  446. * (PECL memcached &gt;= 1.0.0)<br/>
  447. * Return the message describing the result of the last operation
  448. * @link https://php.net/manual/en/memcached.getresultmessage.php
  449. * @return string Message describing the result of the last Memcached operation.
  450. */
  451. public function getResultMessage () {}
  452. /**
  453. * (PECL memcached &gt;= 0.1.0)<br/>
  454. * Retrieve an item
  455. * @link https://php.net/manual/en/memcached.get.php
  456. * @param string $key <p>
  457. * The key of the item to retrieve.
  458. * </p>
  459. * @param callable $cache_cb [optional] <p>
  460. * Read-through caching callback or <b>NULL</b>.
  461. * </p>
  462. * @param int $flags [optional] <p>
  463. * The flags for the get operation.
  464. * </p>
  465. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  466. * The <b>Memcached::getResultCode</b> will return
  467. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  468. */
  469. public function get ($key, callable $cache_cb = null, $flags = 0) {}
  470. /**
  471. * (PECL memcached &gt;= 0.1.0)<br/>
  472. * Retrieve an item from a specific server
  473. * @link https://php.net/manual/en/memcached.getbykey.php
  474. * @param string $server_key <p>
  475. * 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.
  476. * </p>
  477. * @param string $key <p>
  478. * The key of the item to fetch.
  479. * </p>
  480. * @param callable $cache_cb [optional] <p>
  481. * Read-through caching callback or <b>NULL</b>
  482. * </p>
  483. * @param int $flags [optional] <p>
  484. * The flags for the get operation.
  485. * </p>
  486. * @return mixed the value stored in the cache or <b>FALSE</b> otherwise.
  487. * The <b>Memcached::getResultCode</b> will return
  488. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  489. */
  490. public function getByKey ($server_key, $key, callable $cache_cb = null, $flags = 0) {}
  491. /**
  492. * (PECL memcached &gt;= 0.1.0)<br/>
  493. * Retrieve multiple items
  494. * @link https://php.net/manual/en/memcached.getmulti.php
  495. * @param array $keys <p>
  496. * Array of keys to retrieve.
  497. * </p>
  498. * @param int $flags [optional] <p>
  499. * The flags for the get operation.
  500. * </p>
  501. * @return mixed the array of found items or <b>FALSE</b> on failure.
  502. * Use <b>Memcached::getResultCode</b> if necessary.
  503. */
  504. public function getMulti (array $keys, $flags = null) {}
  505. /**
  506. * (PECL memcached &gt;= 0.1.0)<br/>
  507. * Retrieve multiple items from a specific server
  508. * @link https://php.net/manual/en/memcached.getmultibykey.php
  509. * @param string $server_key <p>
  510. * 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.
  511. * </p>
  512. * @param array $keys <p>
  513. * Array of keys to retrieve.
  514. * </p>
  515. * @param int $flags [optional] <p>
  516. * The flags for the get operation.
  517. * </p>
  518. * @return array|false the array of found items or <b>FALSE</b> on failure.
  519. * Use <b>Memcached::getResultCode</b> if necessary.
  520. */
  521. public function getMultiByKey ($server_key, array $keys, $flags = 0) {}
  522. /**
  523. * (PECL memcached &gt;= 0.1.0)<br/>
  524. * Request multiple items
  525. * @link https://php.net/manual/en/memcached.getdelayed.php
  526. * @param array $keys <p>
  527. * Array of keys to request.
  528. * </p>
  529. * @param bool $with_cas [optional] <p>
  530. * Whether to request CAS token values also.
  531. * </p>
  532. * @param callable $value_cb [optional] <p>
  533. * The result callback or <b>NULL</b>.
  534. * </p>
  535. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  536. * Use <b>Memcached::getResultCode</b> if necessary.
  537. */
  538. public function getDelayed (array $keys, $with_cas = null, callable $value_cb = null) {}
  539. /**
  540. * (PECL memcached &gt;= 0.1.0)<br/>
  541. * Request multiple items from a specific server
  542. * @link https://php.net/manual/en/memcached.getdelayedbykey.php
  543. * @param string $server_key <p>
  544. * 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.
  545. * </p>
  546. * @param array $keys <p>
  547. * Array of keys to request.
  548. * </p>
  549. * @param bool $with_cas [optional] <p>
  550. * Whether to request CAS token values also.
  551. * </p>
  552. * @param callable $value_cb [optional] <p>
  553. * The result callback or <b>NULL</b>.
  554. * </p>
  555. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  556. * Use <b>Memcached::getResultCode</b> if necessary.
  557. */
  558. public function getDelayedByKey ($server_key, array $keys, $with_cas = null, callable $value_cb = null) {}
  559. /**
  560. * (PECL memcached &gt;= 0.1.0)<br/>
  561. * Fetch the next result
  562. * @link https://php.net/manual/en/memcached.fetch.php
  563. * @return array|false the next result or <b>FALSE</b> otherwise.
  564. * The <b>Memcached::getResultCode</b> will return
  565. * <b>Memcached::RES_END</b> if result set is exhausted.
  566. */
  567. public function fetch () {}
  568. /**
  569. * (PECL memcached &gt;= 0.1.0)<br/>
  570. * Fetch all the remaining results
  571. * @link https://php.net/manual/en/memcached.fetchall.php
  572. * @return array|false the results or <b>FALSE</b> on failure.
  573. * Use <b>Memcached::getResultCode</b> if necessary.
  574. */
  575. public function fetchAll () {}
  576. /**
  577. * (PECL memcached &gt;= 0.1.0)<br/>
  578. * Store an item
  579. * @link https://php.net/manual/en/memcached.set.php
  580. * @param string $key <p>
  581. * The key under which to store the value.
  582. * </p>
  583. * @param mixed $value <p>
  584. * The value to store.
  585. * </p>
  586. * @param int $expiration [optional] <p>
  587. * The expiration time, defaults to 0. See Expiration Times for more info.
  588. * </p>
  589. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  590. * Use <b>Memcached::getResultCode</b> if necessary.
  591. */
  592. public function set ($key, $value, $expiration = 0, $udf_flags = 0) {}
  593. /**
  594. * (PECL memcached &gt;= 0.1.0)<br/>
  595. * Store an item on a specific server
  596. * @link https://php.net/manual/en/memcached.setbykey.php
  597. * @param string $server_key <p>
  598. * 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.
  599. * </p>
  600. * @param string $key <p>
  601. * The key under which to store the value.
  602. * </p>
  603. * @param mixed $value <p>
  604. * The value to store.
  605. * </p>
  606. * @param int $expiration [optional] <p>
  607. * The expiration time, defaults to 0. See Expiration Times for more info.
  608. * </p>
  609. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  610. * Use <b>Memcached::getResultCode</b> if necessary.
  611. */
  612. public function setByKey ($server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  613. /**
  614. * (PECL memcached &gt;= 2.0.0)<br/>
  615. * Set a new expiration on an item
  616. * @link https://php.net/manual/en/memcached.touch.php
  617. * @param string $key <p>
  618. * The key under which to store the value.
  619. * </p>
  620. * @param int $expiration <p>
  621. * The expiration time, defaults to 0. See Expiration Times for more info.
  622. * </p>
  623. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  624. * Use <b>Memcached::getResultCode</b> if necessary.
  625. */
  626. public function touch ($key, $expiration = 0) {}
  627. /**
  628. * (PECL memcached &gt;= 2.0.0)<br/>
  629. * Set a new expiration on an item on a specific server
  630. * @link https://php.net/manual/en/memcached.touchbykey.php
  631. * @param string $server_key <p>
  632. * 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.
  633. * </p>
  634. * @param string $key <p>
  635. * The key under which to store the value.
  636. * </p>
  637. * @param int $expiration <p>
  638. * The expiration time, defaults to 0. See Expiration Times for more info.
  639. * </p>
  640. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  641. * Use <b>Memcached::getResultCode</b> if necessary.
  642. */
  643. public function touchByKey ($server_key, $key, $expiration) {}
  644. /**
  645. * (PECL memcached &gt;= 0.1.0)<br/>
  646. * Store multiple items
  647. * @link https://php.net/manual/en/memcached.setmulti.php
  648. * @param array $items <p>
  649. * An array of key/value pairs to store on the server.
  650. * </p>
  651. * @param int $expiration [optional] <p>
  652. * The expiration time, defaults to 0. See Expiration Times for more info.
  653. * </p>
  654. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  655. * Use <b>Memcached::getResultCode</b> if necessary.
  656. */
  657. public function setMulti (array $items, $expiration = 0, $udf_flags = 0) {}
  658. /**
  659. * (PECL memcached &gt;= 0.1.0)<br/>
  660. * Store multiple items on a specific server
  661. * @link https://php.net/manual/en/memcached.setmultibykey.php
  662. * @param string $server_key <p>
  663. * 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.
  664. * </p>
  665. * @param array $items <p>
  666. * An array of key/value pairs to store on the server.
  667. * </p>
  668. * @param int $expiration [optional] <p>
  669. * The expiration time, defaults to 0. See Expiration Times for more info.
  670. * </p>
  671. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  672. * Use <b>Memcached::getResultCode</b> if necessary.
  673. */
  674. public function setMultiByKey ($server_key, array $items, $expiration = 0, $udf_flags = 0) {}
  675. /**
  676. * (PECL memcached &gt;= 0.1.0)<br/>
  677. * Compare and swap an item
  678. * @link https://php.net/manual/en/memcached.cas.php
  679. * @param float $cas_token <p>
  680. * Unique value associated with the existing item. Generated by memcache.
  681. * </p>
  682. * @param string $key <p>
  683. * The key under which to store the value.
  684. * </p>
  685. * @param mixed $value <p>
  686. * The value to store.
  687. * </p>
  688. * @param int $expiration [optional] <p>
  689. * The expiration time, defaults to 0. See Expiration Times for more info.
  690. * </p>
  691. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  692. * The <b>Memcached::getResultCode</b> will return
  693. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  694. * to store has been modified since you last fetched it.
  695. */
  696. public function cas ($cas_token, $key, $value, $expiration = 0, $udf_flags = 0) {}
  697. /**
  698. * (PECL memcached &gt;= 0.1.0)<br/>
  699. * Compare and swap an item on a specific server
  700. * @link https://php.net/manual/en/memcached.casbykey.php
  701. * @param float $cas_token <p>
  702. * Unique value associated with the existing item. Generated by memcache.
  703. * </p>
  704. * @param string $server_key <p>
  705. * 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.
  706. * </p>
  707. * @param string $key <p>
  708. * The key under which to store the value.
  709. * </p>
  710. * @param mixed $value <p>
  711. * The value to store.
  712. * </p>
  713. * @param int $expiration [optional] <p>
  714. * The expiration time, defaults to 0. See Expiration Times for more info.
  715. * </p>
  716. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  717. * The <b>Memcached::getResultCode</b> will return
  718. * <b>Memcached::RES_DATA_EXISTS</b> if the item you are trying
  719. * to store has been modified since you last fetched it.
  720. */
  721. public function casByKey ($cas_token, $server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  722. /**
  723. * (PECL memcached &gt;= 0.1.0)<br/>
  724. * Add an item under a new key
  725. * @link https://php.net/manual/en/memcached.add.php
  726. * @param string $key <p>
  727. * The key under which to store the value.
  728. * </p>
  729. * @param mixed $value <p>
  730. * The value to store.
  731. * </p>
  732. * @param int $expiration [optional] <p>
  733. * The expiration time, defaults to 0. See Expiration Times for more info.
  734. * </p>
  735. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  736. * The <b>Memcached::getResultCode</b> will return
  737. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  738. */
  739. public function add ($key, $value, $expiration = 0, $udf_flags = 0) {}
  740. /**
  741. * (PECL memcached &gt;= 0.1.0)<br/>
  742. * Add an item under a new key on a specific server
  743. * @link https://php.net/manual/en/memcached.addbykey.php
  744. * @param string $server_key <p>
  745. * 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.
  746. * </p>
  747. * @param string $key <p>
  748. * The key under which to store the value.
  749. * </p>
  750. * @param mixed $value <p>
  751. * The value to store.
  752. * </p>
  753. * @param int $expiration [optional] <p>
  754. * The expiration time, defaults to 0. See Expiration Times for more info.
  755. * </p>
  756. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  757. * The <b>Memcached::getResultCode</b> will return
  758. * <b>Memcached::RES_NOTSTORED</b> if the key already exists.
  759. */
  760. public function addByKey ($server_key, $key, $value, $expiration = 0, $udf_flags = 0) {}
  761. /**
  762. * (PECL memcached &gt;= 0.1.0)<br/>
  763. * Append data to an existing item
  764. * @link https://php.net/manual/en/memcached.append.php
  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 append ($key, $value) {}
  776. /**
  777. * (PECL memcached &gt;= 0.1.0)<br/>
  778. * Append data to an existing item on a specific server
  779. * @link https://php.net/manual/en/memcached.appendbykey.php
  780. * @param string $server_key <p>
  781. * 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.
  782. * </p>
  783. * @param string $key <p>
  784. * The key under which to store the value.
  785. * </p>
  786. * @param string $value <p>
  787. * The string to append.
  788. * </p>
  789. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  790. * The <b>Memcached::getResultCode</b> will return
  791. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  792. */
  793. public function appendByKey ($server_key, $key, $value) {}
  794. /**
  795. * (PECL memcached &gt;= 0.1.0)<br/>
  796. * Prepend data to an existing item
  797. * @link https://php.net/manual/en/memcached.prepend.php
  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 prepend ($key, $value) {}
  809. /**
  810. * (PECL memcached &gt;= 0.1.0)<br/>
  811. * Prepend data to an existing item on a specific server
  812. * @link https://php.net/manual/en/memcached.prependbykey.php
  813. * @param string $server_key <p>
  814. * 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.
  815. * </p>
  816. * @param string $key <p>
  817. * The key of the item to prepend the data to.
  818. * </p>
  819. * @param string $value <p>
  820. * The string to prepend.
  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 prependByKey ($server_key, $key, $value) {}
  827. /**
  828. * (PECL memcached &gt;= 0.1.0)<br/>
  829. * Replace the item under an existing key
  830. * @link https://php.net/manual/en/memcached.replace.php
  831. * @param string $key <p>
  832. * The key under which to store the value.
  833. * </p>
  834. * @param mixed $value <p>
  835. * The value to store.
  836. * </p>
  837. * @param int $expiration [optional] <p>
  838. * The expiration time, defaults to 0. See Expiration Times for more info.
  839. * </p>
  840. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  841. * The <b>Memcached::getResultCode</b> will return
  842. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  843. */
  844. public function replace ($key, $value, $expiration = null, $udf_flags = 0) {}
  845. /**
  846. * (PECL memcached &gt;= 0.1.0)<br/>
  847. * Replace the item under an existing key on a specific server
  848. * @link https://php.net/manual/en/memcached.replacebykey.php
  849. * @param string $server_key <p>
  850. * 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.
  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. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  862. * The <b>Memcached::getResultCode</b> will return
  863. * <b>Memcached::RES_NOTSTORED</b> if the key does not exist.
  864. */
  865. public function replaceByKey ($server_key, $key, $value, $expiration = null, $udf_flags = 0) {}
  866. /**
  867. * (PECL memcached &gt;= 0.1.0)<br/>
  868. * Delete an item
  869. * @link https://php.net/manual/en/memcached.delete.php
  870. * @param string $key <p>
  871. * The key to be deleted.
  872. * </p>
  873. * @param int $time [optional] <p>
  874. * The amount of time the server will wait to delete the item.
  875. * </p>
  876. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  877. * The <b>Memcached::getResultCode</b> will return
  878. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  879. */
  880. public function delete ($key, $time = 0) {}
  881. /**
  882. * (PECL memcached &gt;= 2.0.0)<br/>
  883. * Delete multiple items
  884. * @link https://php.net/manual/en/memcached.deletemulti.php
  885. * @param array $keys <p>
  886. * The keys to be deleted.
  887. * </p>
  888. * @param int $time [optional] <p>
  889. * The amount of time the server will wait to delete the items.
  890. * </p>
  891. * @return array Returns array indexed by keys and where values are indicating whether operation succeeded or not.
  892. * The <b>Memcached::getResultCode</b> will return
  893. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  894. */
  895. public function deleteMulti (array $keys, $time = 0) {}
  896. /**
  897. * (PECL memcached &gt;= 0.1.0)<br/>
  898. * Delete an item from a specific server
  899. * @link https://php.net/manual/en/memcached.deletebykey.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 string $key <p>
  904. * The key to be deleted.
  905. * </p>
  906. * @param int $time [optional] <p>
  907. * The amount of time the server will wait to delete the item.
  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 deleteByKey ($server_key, $key, $time = 0) {}
  914. /**
  915. * (PECL memcached &gt;= 2.0.0)<br/>
  916. * Delete multiple items from a specific server
  917. * @link https://php.net/manual/en/memcached.deletemultibykey.php
  918. * @param string $server_key <p>
  919. * 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.
  920. * </p>
  921. * @param array $keys <p>
  922. * The keys to be deleted.
  923. * </p>
  924. * @param int $time [optional] <p>
  925. * The amount of time the server will wait to delete the items.
  926. * </p>
  927. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  928. * The <b>Memcached::getResultCode</b> will return
  929. * <b>Memcached::RES_NOTFOUND</b> if the key does not exist.
  930. */
  931. public function deleteMultiByKey ($server_key, array $keys, $time = 0) {}
  932. /**
  933. * (PECL memcached &gt;= 0.1.0)<br/>
  934. * Increment numeric item's value
  935. * @link https://php.net/manual/en/memcached.increment.php
  936. * @param string $key <p>
  937. * The key of the item to increment.
  938. * </p>
  939. * @param int $offset [optional] <p>
  940. * The amount by which to increment the item's value.
  941. * </p>
  942. * @param int $initial_value [optional] <p>
  943. * The value to set the item to if it doesn't currently exist.
  944. * </p>
  945. * @param int $expiry [optional] <p>
  946. * The expiry time to set on the item.
  947. * </p>
  948. * @return int|false new item's value on success or <b>FALSE</b> on failure.
  949. */
  950. public function increment ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  951. /**
  952. * (PECL memcached &gt;= 0.1.0)<br/>
  953. * Decrement numeric item's value
  954. * @link https://php.net/manual/en/memcached.decrement.php
  955. * @param string $key <p>
  956. * The key of the item to decrement.
  957. * </p>
  958. * @param int $offset [optional] <p>
  959. * The amount by which to decrement the item's value.
  960. * </p>
  961. * @param int $initial_value [optional] <p>
  962. * The value to set the item to if it doesn't currently exist.
  963. * </p>
  964. * @param int $expiry [optional] <p>
  965. * The expiry time to set on the item.
  966. * </p>
  967. * @return int|false item's new value on success or <b>FALSE</b> on failure.
  968. */
  969. public function decrement ($key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  970. /**
  971. * (PECL memcached &gt;= 2.0.0)<br/>
  972. * Increment numeric item's value, stored on a specific server
  973. * @link https://php.net/manual/en/memcached.incrementbykey.php
  974. * @param string $server_key <p>
  975. * 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.
  976. * </p>
  977. * @param string $key <p>
  978. * The key of the item to increment.
  979. * </p>
  980. * @param int $offset [optional] <p>
  981. * The amount by which to increment the item's value.
  982. * </p>
  983. * @param int $initial_value [optional] <p>
  984. * The value to set the item to if it doesn't currently exist.
  985. * </p>
  986. * @param int $expiry [optional] <p>
  987. * The expiry time to set on the item.
  988. * </p>
  989. * @return int|false new item's value on success or <b>FALSE</b> on failure.
  990. */
  991. public function incrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  992. /**
  993. * (PECL memcached &gt;= 2.0.0)<br/>
  994. * Decrement numeric item's value, stored on a specific server
  995. * @link https://php.net/manual/en/memcached.decrementbykey.php
  996. * @param string $server_key <p>
  997. * 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.
  998. * </p>
  999. * @param string $key <p>
  1000. * The key of the item to decrement.
  1001. * </p>
  1002. * @param int $offset [optional] <p>
  1003. * The amount by which to decrement the item's value.
  1004. * </p>
  1005. * @param int $initial_value [optional] <p>
  1006. * The value to set the item to if it doesn't currently exist.
  1007. * </p>
  1008. * @param int $expiry [optional] <p>
  1009. * The expiry time to set on the item.
  1010. * </p>
  1011. * @return int|false item's new value on success or <b>FALSE</b> on failure.
  1012. */
  1013. public function decrementByKey ($server_key, $key, $offset = 1, $initial_value = 0, $expiry = 0) {}
  1014. /**
  1015. * (PECL memcached &gt;= 0.1.0)<br/>
  1016. * Add a server to the server pool
  1017. * @link https://php.net/manual/en/memcached.addserver.php
  1018. * @param string $host <p>
  1019. * The hostname of the memcache server. If the hostname is invalid, data-related
  1020. * operations will set
  1021. * <b>Memcached::RES_HOST_LOOKUP_FAILURE</b> result code.
  1022. * </p>
  1023. * @param int $port <p>
  1024. * The port on which memcache is running. Usually, this is
  1025. * 11211.
  1026. * </p>
  1027. * @param int $weight [optional] <p>
  1028. * The weight of the server relative to the total weight of all the
  1029. * servers in the pool. This controls the probability of the server being
  1030. * selected for operations. This is used only with consistent distribution
  1031. * option and usually corresponds to the amount of memory available to
  1032. * memcache on that server.
  1033. * </p>
  1034. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1035. */
  1036. public function addServer ($host, $port, $weight = 0) {}
  1037. /**
  1038. * (PECL memcached &gt;= 0.1.1)<br/>
  1039. * Add multiple servers to the server pool
  1040. * @link https://php.net/manual/en/memcached.addservers.php
  1041. * @param array $servers
  1042. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1043. */
  1044. public function addServers (array $servers) {}
  1045. /**
  1046. * (PECL memcached &gt;= 0.1.0)<br/>
  1047. * Get the list of the servers in the pool
  1048. * @link https://php.net/manual/en/memcached.getserverlist.php
  1049. * @return array The list of all servers in the server pool.
  1050. */
  1051. public function getServerList () {}
  1052. /**
  1053. * (PECL memcached &gt;= 0.1.0)<br/>
  1054. * Map a key to a server
  1055. * @link https://php.net/manual/en/memcached.getserverbykey.php
  1056. * @param string $server_key <p>
  1057. * 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.
  1058. * </p>
  1059. * @return array an array containing three keys of host,
  1060. * port, and weight on success or <b>FALSE</b>
  1061. * on failure.
  1062. * Use <b>Memcached::getResultCode</b> if necessary.
  1063. */
  1064. public function getServerByKey ($server_key) {}
  1065. /**
  1066. * (PECL memcached &gt;= 2.0.0)<br/>
  1067. * Clears all servers from the server list
  1068. * @link https://php.net/manual/en/memcached.resetserverlist.php
  1069. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1070. */
  1071. public function resetServerList () {}
  1072. /**
  1073. * (PECL memcached &gt;= 2.0.0)<br/>
  1074. * Close any open connections
  1075. * @link https://php.net/manual/en/memcached.quit.php
  1076. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1077. */
  1078. public function quit () {}
  1079. /**
  1080. * (PECL memcached &gt;= 0.1.0)<br/>
  1081. * Get server pool statistics
  1082. * @link https://php.net/manual/en/memcached.getstats.php
  1083. * @param string $type
  1084. * @return array Array of server statistics, one entry per server.
  1085. */
  1086. public function getStats ($type = null) {}
  1087. /**
  1088. * (PECL memcached &gt;= 0.1.5)<br/>
  1089. * Get server pool version info
  1090. * @link https://php.net/manual/en/memcached.getversion.php
  1091. * @return array Array of server versions, one entry per server.
  1092. */
  1093. public function getVersion () {}
  1094. /**
  1095. * (PECL memcached &gt;= 2.0.0)<br/>
  1096. * Gets the keys stored on all the servers
  1097. * @link https://php.net/manual/en/memcached.getallkeys.php
  1098. * @return array|false the keys stored on all the servers on success or <b>FALSE</b> on failure.
  1099. */
  1100. public function getAllKeys () {}
  1101. /**
  1102. * (PECL memcached &gt;= 0.1.0)<br/>
  1103. * Invalidate all items in the cache
  1104. * @link https://php.net/manual/en/memcached.flush.php
  1105. * @param int $delay [optional] <p>
  1106. * Numer of seconds to wait before invalidating the items.
  1107. * </p>
  1108. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1109. * Use <b>Memcached::getResultCode</b> if necessary.
  1110. */
  1111. public function flush ($delay = 0) {}
  1112. /**
  1113. * (PECL memcached &gt;= 0.1.0)<br/>
  1114. * Retrieve a Memcached option value
  1115. * @link https://php.net/manual/en/memcached.getoption.php
  1116. * @param int $option <p>
  1117. * One of the Memcached::OPT_* constants.
  1118. * </p>
  1119. * @return mixed the value of the requested option, or <b>FALSE</b> on
  1120. * error.
  1121. */
  1122. public function getOption ($option) {}
  1123. /**
  1124. * (PECL memcached &gt;= 0.1.0)<br/>
  1125. * Set a Memcached option
  1126. * @link https://php.net/manual/en/memcached.setoption.php
  1127. * @param int $option
  1128. * @param mixed $value
  1129. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1130. */
  1131. public function setOption ($option, $value) {}
  1132. /**
  1133. * (PECL memcached &gt;= 2.0.0)<br/>
  1134. * Set Memcached options
  1135. * @link https://php.net/manual/en/memcached.setoptions.php
  1136. * @param array $options <p>
  1137. * An associative array of options where the key is the option to set and
  1138. * the value is the new value for the option.
  1139. * </p>
  1140. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1141. */
  1142. public function setOptions (array $options) {}
  1143. /**
  1144. * (PECL memcached &gt;= 2.0.0)<br/>
  1145. * Set the credentials to use for authentication
  1146. * @link https://secure.php.net/manual/en/memcached.setsaslauthdata.php
  1147. * @param string $username <p>
  1148. * The username to use for authentication.
  1149. * </p>
  1150. * @param string $password <p>
  1151. * The password to use for authentication.
  1152. * </p>
  1153. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1154. */
  1155. public function setSaslAuthData (string $username , string $password) {}
  1156. /**
  1157. * (PECL memcached &gt;= 2.0.0)<br/>
  1158. * Check if a persitent connection to memcache is being used
  1159. * @link https://php.net/manual/en/memcached.ispersistent.php
  1160. * @return bool true if Memcache instance uses a persistent connection, false otherwise.
  1161. */
  1162. public function isPersistent () {}
  1163. /**
  1164. * (PECL memcached &gt;= 2.0.0)<br/>
  1165. * Check if the instance was recently created
  1166. * @link https://php.net/manual/en/memcached.ispristine.php
  1167. * @return bool the true if instance is recently created, false otherwise.
  1168. */
  1169. public function isPristine () {}
  1170. public function flushBuffers () {}
  1171. public function setEncodingKey ( $key ) {}
  1172. public function getLastDisconnectedServer () {}
  1173. public function getLastErrorErrno () {}
  1174. public function getLastErrorCode () {}
  1175. public function getLastErrorMessage () {}
  1176. public function setBucket (array $host_map, array $forward_map, $replicas) {}
  1177. }
  1178. /**
  1179. * @link https://php.net/manual/en/class.memcachedexception.php
  1180. */
  1181. class MemcachedException extends RuntimeException {
  1182. }
  1183. // End of memcached v.3.0.4
  1184. ?>