DummyKeyCache.php 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. A dummy KeyCache used to exclude cache layer from problems
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. /**
  16. * A basic KeyCache backed by an array.
  17. * @package Swift
  18. * @subpackage KeyCache
  19. * @author Xavier De Cock <xdecock@gmail.com>
  20. */
  21. class Swift_KeyCache_DummyKeyCache implements Swift_KeyCache
  22. {
  23. /**
  24. * Set a string into the cache under $itemKey for the namespace $nsKey.
  25. * @param string $nsKey
  26. * @param string $itemKey
  27. * @param string $string
  28. * @param integer $mode
  29. * @see MODE_WRITE, MODE_APPEND
  30. */
  31. public function setString($nsKey, $itemKey, $string, $mode)
  32. {
  33. }
  34. /**
  35. * Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
  36. * @param string $nsKey
  37. * @param string $itemKey
  38. * @param Swift_OutputByteStream $os
  39. * @param integer $mode
  40. * @see MODE_WRITE, MODE_APPEND
  41. */
  42. public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
  43. {
  44. }
  45. /**
  46. * Provides a ByteStream which when written to, writes data to $itemKey.
  47. * NOTE: The stream will always write in append mode.
  48. * @param string $nsKey
  49. * @param string $itemKey
  50. * @param Swift_InputByteStream $writeThrough
  51. * @return Swift_InputByteStream
  52. */
  53. public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
  54. {
  55. return false;
  56. }
  57. /**
  58. * Get data back out of the cache as a string.
  59. * @param string $nsKey
  60. * @param string $itemKey
  61. * @return string
  62. */
  63. public function getString($nsKey, $itemKey)
  64. {
  65. return false;
  66. }
  67. /**
  68. * Get data back out of the cache as a ByteStream.
  69. * @param string $nsKey
  70. * @param string $itemKey
  71. * @param Swift_InputByteStream $is to write the data to
  72. *
  73. * @return boolean
  74. */
  75. public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
  76. {
  77. return false;
  78. }
  79. /**
  80. * Check if the given $itemKey exists in the namespace $nsKey.
  81. * @param string $nsKey
  82. * @param string $itemKey
  83. * @return boolean
  84. */
  85. public function hasKey($nsKey, $itemKey)
  86. {
  87. return false;
  88. }
  89. /**
  90. * Clear data for $itemKey in the namespace $nsKey if it exists.
  91. * @param string $nsKey
  92. * @param string $itemKey
  93. */
  94. public function clearKey($nsKey, $itemKey)
  95. {
  96. }
  97. /**
  98. * Clear all data in the namespace $nsKey if it exists.
  99. * @param string $nsKey
  100. */
  101. public function clearAll($nsKey)
  102. {
  103. }
  104. }