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

## Source for file options.php

Documentation is available at options.php

1. <?php
2. /**
3. * This file contains the ezcDebugOptions 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 Debug
23. * @version //autogentag//
24. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
25. * @filesource
26. */
28. /**
29. * Options class for ezcDebug.
30. *
31. * @property bool $stackTrace
32. * Determines if a stack trace is stored and displayed with every
33. * debug message by default. Default is false.
34. * @property int $stackTraceDepth
35. * The number of levels to store for the stack trace. 0 means no
36. * limit and a complete stack trace will always be stored. Not that
37. * this might consume a large amount of memory. Default is 5.
38. * @property int $stackTraceMaxData
39. * Maximum bytes of data to print per variable in a stacktrace. This
40. * option does only affect {@link ezcDebugPhpStacktraceIterator},
41. * {@link ezcDebugXdebugStacktraceIterator} is configured by the
42. * Xdebug INI settings. Default is 512. Set to false to show all data.
43. * @property int $stackTraceMaxChildren
44. * Maximum number of children to dump on 1 level in array and object
45. * structures. This option does only affect {@link }
46. * ezcDebugPhpStacktraceIterator}, {@link }
47. * ezcDebugXdebugStacktraceIterator} is configured by the Xdebug INI
48. * settings. Default is 128. Set to false to show all children.
49. * @property int $stackTraceMaxDepth
50. * Maximum depth to recurse into array and object structures in a
51. * stack trace. This option does only affect {@link }
52. * ezcDebugPhpStacktraceIterator}, {@link }
53. * ezcDebugXdebugStacktraceIterator} is configured by the Xdebug INI
54. * settings. Default is 3. Set to false to recurse fully.
55. *
56. * @package Debug
57. * @version //autogen//
58. */
59. class ezcDebugOptions extends ezcBaseOptions
60. {
61. /**
62. * Properties.
63. *
64. * @var array(string=>mixed)
65. */
66. protected $properties = array(
67. 'stackTrace' => false,
68. 'stackTraceDepth' => 5,
69. 'stackTraceMaxData' => 512,
70. 'stackTraceMaxChildren' => 128,
71. 'stackTraceMaxDepth' => 3,
72. );
74. /**
75. * Property write access.
76. *
77. * @param string $propertyName Name of the property.
78. * @param mixed $propertyValue The value for the property.
79. *
80. * @throws ezcBasePropertyPermissionException
81. * If the property you try to access is read-only.
82. * @throws ezcBasePropertyNotFoundException
83. * If the the desired property is not found.
84. * @ignore
85. */
86. public function __set( $propertyName, $propertyValue )
87. {
88. switch ( $propertyName )
89. {
90. case 'stackTrace':
91. if ( ! is_bool ( $propertyValue ) )
92. {
93. throw new ezcBaseValueException (
94. $propertyName,
95. $propertyValue,
96. 'bool'
97. );
98. }
99. break;
100. case 'stackTraceDepth':
101. if ( ! is_int ( $propertyValue ) || $propertyValue < 0 )
102. {
103. throw new ezcBaseValueException (
104. $propertyName,
105. $propertyValue,
106. 'int >= 0'
107. );
108. }
109. break;
110. case 'stackTraceMaxData':
111. case 'stackTraceMaxChildren':
112. case 'stackTraceMaxDepth':
113. if ( ( ! is_int ( $propertyValue ) || $propertyValue < 0 ) && ( $propertyValue !== false ) )
114. {
115. throw new ezcBaseValueException (
116. $propertyName,
117. $propertyValue,
118. 'int >= 0 or false'
119. );
120. }
121. break;
122. default:
123. ezcBasePropertyNotFoundException ( $propertyName );
124. }
125. $this-> properties [$propertyName] = $propertyValue;
126. }
127. }
129. ?>

Documentation generated by phpDocumentor 1.4.3