NullKeyCache.php 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. * @package Swift
  13. * @subpackage KeyCache
  14. * @author Chris Corbyn
  15. */
  16. class Swift_KeyCache_NullKeyCache implements Swift_KeyCache
  17. {
  18. /**
  19. * Set a string into the cache under $itemKey for the namespace $nsKey.
  20. *
  21. * @see MODE_WRITE, MODE_APPEND
  22. *
  23. * @param string $nsKey
  24. * @param string $itemKey
  25. * @param string $string
  26. * @param integer $mode
  27. */
  28. public function setString($nsKey, $itemKey, $string, $mode)
  29. {
  30. }
  31. /**
  32. * Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
  33. *
  34. * @see MODE_WRITE, MODE_APPEND
  35. *
  36. * @param string $nsKey
  37. * @param string $itemKey
  38. * @param Swift_OutputByteStream $os
  39. * @param integer $mode
  40. */
  41. public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
  42. {
  43. }
  44. /**
  45. * Provides a ByteStream which when written to, writes data to $itemKey.
  46. *
  47. * NOTE: The stream will always write in append mode.
  48. *
  49. * @param string $nsKey
  50. * @param string $itemKey
  51. * @param Swift_InputByteStream $writeThrough
  52. *
  53. * @return Swift_InputByteStream
  54. */
  55. public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
  56. {
  57. }
  58. /**
  59. * Get data back out of the cache as a string.
  60. *
  61. * @param string $nsKey
  62. * @param string $itemKey
  63. *
  64. * @return string
  65. */
  66. public function getString($nsKey, $itemKey)
  67. {
  68. }
  69. /**
  70. * Get data back out of the cache as a ByteStream.
  71. *
  72. * @param string $nsKey
  73. * @param string $itemKey
  74. * @param Swift_InputByteStream $is to write the data to
  75. */
  76. public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
  77. {
  78. }
  79. /**
  80. * Check if the given $itemKey exists in the namespace $nsKey.
  81. *
  82. * @param string $nsKey
  83. * @param string $itemKey
  84. *
  85. * @return boolean
  86. */
  87. public function hasKey($nsKey, $itemKey)
  88. {
  89. return false;
  90. }
  91. /**
  92. * Clear data for $itemKey in the namespace $nsKey if it exists.
  93. *
  94. * @param string $nsKey
  95. * @param string $itemKey
  96. */
  97. public function clearKey($nsKey, $itemKey)
  98. {
  99. }
  100. /**
  101. * Clear all data in the namespace $nsKey if it exists.
  102. *
  103. * @param string $nsKey
  104. */
  105. public function clearAll($nsKey)
  106. {
  107. }
  108. }