sfNoCache.class.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  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. * Cache class that does nothing.
  11. *
  12. * @package symfony
  13. * @subpackage cache
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id: sfNoCache.class.php 10970 2008-08-19 19:02:38Z fabien $
  16. */
  17. class sfNoCache extends sfCache
  18. {
  19. /**
  20. * @see sfCache
  21. */
  22. public function get($key, $default = null)
  23. {
  24. return $default;
  25. }
  26. /**
  27. * @see sfCache
  28. */
  29. public function has($key)
  30. {
  31. return false;
  32. }
  33. /**
  34. * @see sfCache
  35. */
  36. public function set($key, $data, $lifetime = null)
  37. {
  38. return true;
  39. }
  40. /**
  41. * @see sfCache
  42. */
  43. public function remove($key)
  44. {
  45. return true;
  46. }
  47. /**
  48. * @see sfCache
  49. */
  50. public function removePattern($pattern)
  51. {
  52. return true;
  53. }
  54. /**
  55. * @see sfCache
  56. */
  57. public function clean($mode = self::ALL)
  58. {
  59. return true;
  60. }
  61. /**
  62. * @see sfCache
  63. */
  64. public function getLastModified($key)
  65. {
  66. return 0;
  67. }
  68. /**
  69. * @see sfCache
  70. */
  71. public function getTimeout($key)
  72. {
  73. return 0;
  74. }
  75. }