NullKeyCache.php 2.4KB

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