NullKeyCache.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * A null KeyCache that does not cache at all.
  11. *
  12. * @author Chris Corbyn
  13. */
  14. class Swift_KeyCache_NullKeyCache implements Swift_KeyCache
  15. {
  16. /**
  17. * Set a string into the cache under $itemKey for the namespace $nsKey.
  18. *
  19. * @see MODE_WRITE, MODE_APPEND
  20. *
  21. * @param string $nsKey
  22. * @param string $itemKey
  23. * @param string $string
  24. * @param int $mode
  25. */
  26. public function setString($nsKey, $itemKey, $string, $mode)
  27. {
  28. }
  29. /**
  30. * Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
  31. *
  32. * @see MODE_WRITE, MODE_APPEND
  33. *
  34. * @param string $nsKey
  35. * @param string $itemKey
  36. * @param Swift_OutputByteStream $os
  37. * @param int $mode
  38. */
  39. public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
  40. {
  41. }
  42. /**
  43. * Provides a ByteStream which when written to, writes data to $itemKey.
  44. *
  45. * NOTE: The stream will always write in append mode.
  46. *
  47. * @param string $nsKey
  48. * @param string $itemKey
  49. * @param Swift_InputByteStream $writeThrough
  50. *
  51. * @return Swift_InputByteStream
  52. */
  53. public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
  54. {
  55. }
  56. /**
  57. * Get data back out of the cache as a string.
  58. *
  59. * @param string $nsKey
  60. * @param string $itemKey
  61. *
  62. * @return string
  63. */
  64. public function getString($nsKey, $itemKey)
  65. {
  66. }
  67. /**
  68. * Get data back out of the cache as a ByteStream.
  69. *
  70. * @param string $nsKey
  71. * @param string $itemKey
  72. * @param Swift_InputByteStream $is to write the data to
  73. */
  74. public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
  75. {
  76. }
  77. /**
  78. * Check if the given $itemKey exists in the namespace $nsKey.
  79. *
  80. * @param string $nsKey
  81. * @param string $itemKey
  82. *
  83. * @return bool
  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. *
  92. * @param string $nsKey
  93. * @param string $itemKey
  94. */
  95. public function clearKey($nsKey, $itemKey)
  96. {
  97. }
  98. /**
  99. * Clear all data in the namespace $nsKey if it exists.
  100. *
  101. * @param string $nsKey
  102. */
  103. public function clearAll($nsKey)
  104. {
  105. }
  106. }