ExtendedInterface.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Cache
  17. * @subpackage Zend_Cache_Backend
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @see Zend_Cache_Backend_Interface
  23. */
  24. require_once 'Zend/Cache/Backend/Interface.php';
  25. /**
  26. * @package Zend_Cache
  27. * @subpackage Zend_Cache_Backend
  28. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. */
  31. interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface
  32. {
  33. /**
  34. * Return an array of stored cache ids
  35. *
  36. * @return array array of stored cache ids (string)
  37. */
  38. public function getIds();
  39. /**
  40. * Return an array of stored tags
  41. *
  42. * @return array array of stored tags (string)
  43. */
  44. public function getTags();
  45. /**
  46. * Return an array of stored cache ids which match given tags
  47. *
  48. * In case of multiple tags, a logical AND is made between tags
  49. *
  50. * @param array $tags array of tags
  51. * @return array array of matching cache ids (string)
  52. */
  53. public function getIdsMatchingTags($tags = array());
  54. /**
  55. * Return an array of stored cache ids which don't match given tags
  56. *
  57. * In case of multiple tags, a logical OR is made between tags
  58. *
  59. * @param array $tags array of tags
  60. * @return array array of not matching cache ids (string)
  61. */
  62. public function getIdsNotMatchingTags($tags = array());
  63. /**
  64. * Return an array of stored cache ids which match any given tags
  65. *
  66. * In case of multiple tags, a logical AND is made between tags
  67. *
  68. * @param array $tags array of tags
  69. * @return array array of any matching cache ids (string)
  70. */
  71. public function getIdsMatchingAnyTags($tags = array());
  72. /**
  73. * Return the filling percentage of the backend storage
  74. *
  75. * @return int integer between 0 and 100
  76. */
  77. public function getFillingPercentage();
  78. /**
  79. * Return an array of metadatas for the given cache id
  80. *
  81. * The array must include these keys :
  82. * - expire : the expire timestamp
  83. * - tags : a string array of tags
  84. * - mtime : timestamp of last modification time
  85. *
  86. * @param string $id cache id
  87. * @return array array of metadatas (false if the cache id is not found)
  88. */
  89. public function getMetadatas($id);
  90. /**
  91. * Give (if possible) an extra lifetime to the given cache id
  92. *
  93. * @param string $id cache id
  94. * @param int $extraLifetime
  95. * @return boolean true if ok
  96. */
  97. public function touch($id, $extraLifetime);
  98. /**
  99. * Return an associative array of capabilities (booleans) of the backend
  100. *
  101. * The array must include these keys :
  102. * - automatic_cleaning (is automating cleaning necessary)
  103. * - tags (are tags supported)
  104. * - expired_read (is it possible to read expired cache records
  105. * (for doNotTestCacheValidity option for example))
  106. * - priority does the backend deal with priority when saving
  107. * - infinite_lifetime (is infinite lifetime can work with this backend)
  108. * - get_list (is it possible to get the list of cache ids and the complete list of tags)
  109. *
  110. * @return array associative of with capabilities
  111. */
  112. public function getCapabilities();
  113. }