APCIterator.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * The APCIterator class
  4. *
  5. * The APCIterator class makes it easier to iterate over large APC caches.
  6. * This is helpful as it allows iterating over large caches in steps, while grabbing a defined number
  7. * of entries per lock instance, so it frees the cache locks for other activities rather than hold up
  8. * the entire cache to grab 100 (the default) entries. Also, using regular expression matching is more
  9. * efficient as it's been moved to the C level.
  10. *
  11. * @link http://php.net/manual/en/class.apciterator.php
  12. */
  13. class APCIterator implements Iterator
  14. {
  15. /**
  16. * Constructs an APCIterator iterator object
  17. * @link http://php.net/manual/en/apciterator.construct.php
  18. * @param string $cache The cache type, which will be 'user' or 'file'.
  19. * @param string|string[]|null $search A PCRE regular expression that matches against APC key names,
  20. * either as a string for a single regular expression, or as an array of regular expressions.
  21. * Or, optionally pass in NULL to skip the search.
  22. * @param int $format The desired format, as configured with one ore more of the APC_ITER_* constants.
  23. * @param int $chunk_size The chunk size. Must be a value greater than 0. The default value is 100.
  24. * @param int $list The type to list. Either pass in APC_LIST_ACTIVE or APC_LIST_INACTIVE.
  25. */
  26. public function __construct($cache, $search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE){}
  27. /**
  28. * Rewinds back the iterator to the first element
  29. * @link http://php.net/manual/en/apciterator.rewind.php
  30. */
  31. public function rewind(){}
  32. /**
  33. * Checks if the current iterator position is valid
  34. * @link http://php.net/manual/en/apciterator.valid.php
  35. * @return bool Returns TRUE if the current iterator position is valid, otherwise FALSE.
  36. */
  37. public function valid(){}
  38. /**
  39. * Gets the current item from the APCIterator stack
  40. * @link http://php.net/manual/en/apciterator.current.php
  41. * @return mixed Returns the current item on success, or FALSE if no more items or exist, or on failure.
  42. */
  43. public function current(){}
  44. /**
  45. * Gets the current iterator key
  46. * @link http://php.net/manual/en/apciterator.key.php
  47. * @return string|int|bool Returns the key on success, or FALSE upon failure.
  48. */
  49. public function key(){}
  50. /**
  51. * Moves the iterator pointer to the next element
  52. * @link http://php.net/manual/en/apciterator.next.php
  53. * @return bool Returns TRUE on success or FALSE on failure.
  54. */
  55. public function next(){}
  56. /**
  57. * Gets the total number of cache hits
  58. * @link http://php.net/manual/en/apciterator.gettotalhits.php
  59. * @return int|bool The number of hits on success, or FALSE on failure.
  60. */
  61. public function getTotalHits(){}
  62. /**
  63. * Gets the total cache size
  64. * @link http://php.net/manual/en/apciterator.gettotalsize.php
  65. * @return int|bool The total cache size.
  66. */
  67. public function getTotalSize(){}
  68. /**
  69. * Get the total count
  70. * @link http://php.net/manual/en/apciterator.gettotalcount.php
  71. * @return int|bool The total count.
  72. */
  73. public function getTotalCount(){}
  74. }