## Apache Zeta Components Manual :: File Source for storage.php

## Source for file storage.php

Documentation is available at storage.php

1. <?php
2. /**
3. * File containing the ezcCacheStorageOptions class.
4. *
5. * Licensed to the Apache Software Foundation (ASF) under one
6. * or more contributor license agreements. See the NOTICE file
7. * distributed with this work for additional information
8. * regarding copyright ownership. The ASF licenses this file
9. * to you under the Apache License, Version 2.0 (the
10. * "License"); you may not use this file except in compliance
11. * with the License. You may obtain a copy of the License at
12. *
13. * http://www.apache.org/licenses/LICENSE-2.0
14. *
15. * Unless required by applicable law or agreed to in writing,
16. * software distributed under the License is distributed on an
17. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18. * KIND, either express or implied. See the License for the
19. * specific language governing permissions and limitations
20. * under the License.
21. *
22. * @package Cache
23. * @version //autogentag//
24. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
25. * @filesource
26. */
28. /**
29. * Option class for the ezcCacheStorage class.
30. * Instances of this class store the options of ezcCacheStorage
31. * implementations.
32. *
33. * @property int $ttl The time to live of cache entries.
34. * @property string $extension The (file) extension to use for the storage items.
35. *
36. * @package Cache
37. * @version //autogentag//
38. */
39. class ezcCacheStorageOptions extends ezcBaseOptions
40. {
41. /**
42. * Constructs a new options object.
43. *
44. * It also sets the default values of the format property
45. *
46. * @param array(string=>mixed) $options The initial options to set.
47. *
48. * @throws ezcBasePropertyNotFoundException
49. * If trying to assign a property which does not exist
50. * @throws ezcBaseValueException
51. * If the value for the property is incorrect
52. */
53. public function __construct ( $options = array() )
54. {
55. $this-> properties ['ttl'] = 86400;
56. $this-> properties ['extension'] = '.cache';
57. parent:: __construct ( $options );
58. }
60. /**
61. * Sets an option.
62. * This method is called when an option is set.
63. *
64. * @param string $key The option name.
65. * @param mixed $value The option value.
66. * @ignore
67. */
68. public function __set( $key, $value )
69. {
70. switch ( $key )
71. {
72. case "extension":
73. if ( ! is_string ( $value ) || strlen ( $value ) < 1 )
74. {
75. throw new ezcBaseValueException ( $key, $value, "string, size > 0" );
76. }
77. break;
78. case "ttl":
79. if ( ! is_int ( $value ) && $value !== false )
80. {
81. throw new ezcBaseValueException ( $key, $value, "int > 0 or false" );
82. }
83. break;
84. default:
85. throw new ezcBasePropertyNotFoundException ( $key );
86. }
87. $this-> properties [$key] = $value;
88. }
89. }
92. ?>

Documentation generated by phpDocumentor 1.4.3