PageRenderTime 62ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Zend/Cache/Backend/Interface.php

https://bitbucket.org/hamidrezas/melobit
PHP | 99 lines | 10 code | 8 blank | 81 comment | 0 complexity | e3fffb60b0bcd1d804e19ecd6c05be75 MD5 | raw file
Possible License(s): AGPL-1.0
  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-2012 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Interface.php 24594 2012-01-05 21:27:01Z matthew $
  21. */
  22. /**
  23. * @package Zend_Cache
  24. * @subpackage Zend_Cache_Backend
  25. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. interface Zend_Cache_Backend_Interface
  29. {
  30. /**
  31. * Set the frontend directives
  32. *
  33. * @param array $directives assoc of directives
  34. */
  35. public function setDirectives($directives);
  36. /**
  37. * Test if a cache is available for the given id and (if yes) return it (false else)
  38. *
  39. * Note : return value is always "string" (unserialization is done by the core not by the backend)
  40. *
  41. * @param string $id Cache id
  42. * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
  43. * @return string|false cached datas
  44. */
  45. public function load($id, $doNotTestCacheValidity = false);
  46. /**
  47. * Test if a cache is available or not (for the given id)
  48. *
  49. * @param string $id cache id
  50. * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
  51. */
  52. public function test($id);
  53. /**
  54. * Save some string datas into a cache record
  55. *
  56. * Note : $data is always "string" (serialization is done by the
  57. * core not by the backend)
  58. *
  59. * @param string $data Datas to cache
  60. * @param string $id Cache id
  61. * @param array $tags Array of strings, the cache record will be tagged by each string entry
  62. * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
  63. * @return boolean true if no problem
  64. */
  65. public function save($data, $id, $tags = array(), $specificLifetime = false);
  66. /**
  67. * Remove a cache record
  68. *
  69. * @param string $id Cache id
  70. * @return boolean True if no problem
  71. */
  72. public function remove($id);
  73. /**
  74. * Clean some cache records
  75. *
  76. * Available modes are :
  77. * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
  78. * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
  79. * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
  80. * ($tags can be an array of strings or a single string)
  81. * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
  82. * ($tags can be an array of strings or a single string)
  83. * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
  84. * ($tags can be an array of strings or a single string)
  85. *
  86. * @param string $mode Clean mode
  87. * @param array $tags Array of tags
  88. * @return boolean true if no problem
  89. */
  90. public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array());
  91. }