ExtendedInterface.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Cache_Backend_Interface
  24. */
  25. #require_once 'Zend/Cache/Backend/Interface.php';
  26. /**
  27. * @package Zend_Cache
  28. * @subpackage Zend_Cache_Backend
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface
  33. {
  34. /**
  35. * Return an array of stored cache ids
  36. *
  37. * @return array array of stored cache ids (string)
  38. */
  39. public function getIds();
  40. /**
  41. * Return an array of stored tags
  42. *
  43. * @return array array of stored tags (string)
  44. */
  45. public function getTags();
  46. /**
  47. * Return an array of stored cache ids which match given tags
  48. *
  49. * In case of multiple tags, a logical AND is made between tags
  50. *
  51. * @param array $tags array of tags
  52. * @return array array of matching cache ids (string)
  53. */
  54. public function getIdsMatchingTags($tags = array());
  55. /**
  56. * Return an array of stored cache ids which don't match given tags
  57. *
  58. * In case of multiple tags, a logical OR is made between tags
  59. *
  60. * @param array $tags array of tags
  61. * @return array array of not matching cache ids (string)
  62. */
  63. public function getIdsNotMatchingTags($tags = array());
  64. /**
  65. * Return an array of stored cache ids which match any given tags
  66. *
  67. * In case of multiple tags, a logical AND is made between tags
  68. *
  69. * @param array $tags array of tags
  70. * @return array array of any matching cache ids (string)
  71. */
  72. public function getIdsMatchingAnyTags($tags = array());
  73. /**
  74. * Return the filling percentage of the backend storage
  75. *
  76. * @return int integer between 0 and 100
  77. */
  78. public function getFillingPercentage();
  79. /**
  80. * Return an array of metadatas for the given cache id
  81. *
  82. * The array must include these keys :
  83. * - expire : the expire timestamp
  84. * - tags : a string array of tags
  85. * - mtime : timestamp of last modification time
  86. *
  87. * @param string $id cache id
  88. * @return array array of metadatas (false if the cache id is not found)
  89. */
  90. public function getMetadatas($id);
  91. /**
  92. * Give (if possible) an extra lifetime to the given cache id
  93. *
  94. * @param string $id cache id
  95. * @param int $extraLifetime
  96. * @return boolean true if ok
  97. */
  98. public function touch($id, $extraLifetime);
  99. /**
  100. * Return an associative array of capabilities (booleans) of the backend
  101. *
  102. * The array must include these keys :
  103. * - automatic_cleaning (is automating cleaning necessary)
  104. * - tags (are tags supported)
  105. * - expired_read (is it possible to read expired cache records
  106. * (for doNotTestCacheValidity option for example))
  107. * - priority does the backend deal with priority when saving
  108. * - infinite_lifetime (is infinite lifetime can work with this backend)
  109. * - get_list (is it possible to get the list of cache ids and the complete list of tags)
  110. *
  111. * @return array associative of with capabilities
  112. */
  113. public function getCapabilities();
  114. }