# Source for file Driver.php

Documentation is available at Driver.php

1. <?php
2. /*
3. * $Id: Driver.php 1401 2007-05-20 17:54:22Z zYne $
4. *
5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16. *
17. * This software consists of voluntary contributions made by many individuals
18. * and is licensed under the LGPL. For more information, see
19. * <http://www.phpdoctrine.com>.
20. */
22. /**
23. * Doctrine_Cache_Driver
24. *
25. * @package Doctrine
26. * @subpackage Doctrine_Cache
27. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28. * @category Object Relational Mapping
29. * @link www.phpdoctrine.com
30. * @since 1.0
31. * @version $Revision: 1401 $
32. * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
33. */
34. abstract class Doctrine_Cache_Driver implements Doctrine_Cache_Interface
35. {
36. /**
37. * @var array $_options an array of options
38. */
39. protected $_options = array();
41. /**
42. * constructor
43. *
44. * @param array $_options an array of options
45. */
46. public function __construct($options)
47. {
48. $this->_options = $options;
49. }
50. /**
51. * setOption
52. *
53. * @param mixed $option the option name
54. * @param mixed $value option value
55. * @return boolean TRUE on success, FALSE on failure
56. */
57. public function setOption($option, $value)
58. {
59. if (isset($this->_options[$option])) {
60. $this->_options[$option] = $value;
61. return true;
62. }
63. return false;
64. }
65. /**
66. * getOption
67. *
68. * @param mixed $option the option name
69. * @return mixed option value
70. */
71. public function getOption($option)
72. {
73. if ( ! isset($this->_options[$option])) {
74. return null;
75. }
77. return $this->_options[$option];
78. }
79. }