sfNoStorage.class.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * sfNoStorage allows you to disable session support.
  11. *
  12. * To disable sessions, change the storage factory in config/factories.yml:
  13. *
  14. * storage:
  15. * class: sfNoStorage
  16. *
  17. * @package symfony
  18. * @subpackage storage
  19. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  20. * @version SVN: $Id: sfNoStorage.class.php 9942 2008-06-27 18:00:49Z fabien $
  21. */
  22. class sfNoStorage extends sfStorage
  23. {
  24. /**
  25. * Reads data from this storage.
  26. *
  27. * The preferred format for a key is directory style so naming conflicts can be avoided.
  28. *
  29. * @param string $key A unique key identifying your data
  30. *
  31. * @return mixed Data associated with the key
  32. *
  33. * @throws <b>sfStorageException</b> If an error occurs while reading data from this storage
  34. */
  35. public function read($key)
  36. {
  37. return null;
  38. }
  39. /**
  40. * Removes data from this storage.
  41. *
  42. * The preferred format for a key is directory style so naming conflicts can be avoided.
  43. *
  44. * @param string $key A unique key identifying your data
  45. *
  46. * @return mixed Data associated with the key
  47. *
  48. * @throws <b>sfStorageException</b> If an error occurs while removing data from this storage
  49. */
  50. public function remove($key)
  51. {
  52. return null;
  53. }
  54. /**
  55. * Writes data to this storage.
  56. *
  57. * The preferred format for a key is directory style so naming conflicts can be avoided.
  58. *
  59. * @param string $key A unique key identifying your data
  60. * @param mixed $data Data associated with your key
  61. *
  62. * @throws <b>sfStorageException</b> If an error occurs while writing to this storage
  63. */
  64. public function write($key, $data)
  65. {
  66. }
  67. /**
  68. * Regenerates id that represents this storage.
  69. *
  70. * @param boolean $destroy Destroy session when regenerating?
  71. *
  72. * @return boolean True if session regenerated, false if error
  73. *
  74. */
  75. public function regenerate($destroy = false)
  76. {
  77. return true;
  78. }
  79. /**
  80. * Executes the shutdown procedure.
  81. *
  82. * @throws <b>sfStorageException</b> If an error occurs while shutting down this storage
  83. */
  84. public function shutdown()
  85. {
  86. }
  87. }