1 | <?php |
||
19 | class DebuggerOptions extends AbstractOptions |
||
20 | { |
||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | protected $enabled = true; |
||
25 | |||
26 | /** |
||
27 | * @var bool|null |
||
28 | */ |
||
29 | protected $mode = null; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | protected $bar = false; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | */ |
||
39 | protected $strict = true; |
||
40 | |||
41 | /** |
||
42 | * @var string|null |
||
43 | */ |
||
44 | protected $log; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $email = ''; |
||
50 | |||
51 | /** |
||
52 | * @var int |
||
53 | */ |
||
54 | protected $maxDepth = 10; |
||
55 | |||
56 | /** |
||
57 | * @var int |
||
58 | */ |
||
59 | protected $maxLen = 300; |
||
60 | |||
61 | /** |
||
62 | * Is debugger enabled? |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isEnabled() |
||
70 | |||
71 | /** |
||
72 | * Is debugger disabled? |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function isDisabled() |
||
80 | |||
81 | /** |
||
82 | * Debugger mode |
||
83 | * |
||
84 | * true = production|false |
||
85 | * false = development|null |
||
86 | * null = autodetect|IP address(es) csv/array |
||
87 | * |
||
88 | * @return bool|null |
||
89 | */ |
||
90 | public function getMode() |
||
94 | |||
95 | /** |
||
96 | * Is debugger bar enabled? |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | public function hasBar() |
||
104 | |||
105 | /** |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function isStrict() |
||
112 | |||
113 | /** |
||
114 | * @return string Empty string to disable, null for default |
||
115 | */ |
||
116 | public function getLog() |
||
123 | |||
124 | /** |
||
125 | * Administrator address |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getEmail() |
||
133 | |||
134 | /** |
||
135 | * @return int |
||
136 | */ |
||
137 | public function getMaxDepth() |
||
141 | |||
142 | /** |
||
143 | * @return int |
||
144 | */ |
||
145 | public function getMaxLen() |
||
149 | |||
150 | /** |
||
151 | * Enable debugger |
||
152 | * |
||
153 | * @param bool $enabled |
||
154 | * @return $this |
||
155 | */ |
||
156 | public function setEnabled($enabled) |
||
161 | |||
162 | /** |
||
163 | * Debugger mode, production or development. |
||
164 | * |
||
165 | * @param bool|null $mode |
||
166 | * @return $this |
||
167 | */ |
||
168 | public function setMode($mode) |
||
173 | |||
174 | /** |
||
175 | * Force development mode |
||
176 | * |
||
177 | * @return $this |
||
178 | */ |
||
179 | public function setDevMode() |
||
180 | { |
||
181 | $this->setMode(Tracy::DEVELOPMENT); |
||
182 | return $this; |
||
183 | } |
||
184 | |||
185 | /** |
||
186 | * Force production mode |
||
187 | * |
||
188 | * @return $this |
||
189 | */ |
||
190 | public function setPubMode() |
||
191 | { |
||
192 | $this->setMode(Tracy::PRODUCTION); |
||
193 | return $this; |
||
194 | } |
||
195 | |||
196 | /** |
||
197 | * @param bool|true $bar |
||
198 | * @return $this |
||
199 | */ |
||
200 | public function setBar($bar = true) |
||
205 | |||
206 | /** |
||
207 | * Strict errors? |
||
208 | * |
||
209 | * @param bool|true $strict |
||
210 | * @return $this |
||
211 | */ |
||
212 | public function setStrict($strict = true) |
||
217 | |||
218 | /** |
||
219 | * Path to log directory |
||
220 | * |
||
221 | * @param string $log |
||
222 | * @return $this |
||
223 | */ |
||
224 | public function setLog($log) |
||
229 | |||
230 | /** |
||
231 | * Configure debugger administrator email |
||
232 | * |
||
233 | * @param string $email |
||
234 | * @return $this |
||
235 | */ |
||
236 | public function setEmail($email) |
||
241 | |||
242 | /** |
||
243 | * Variable dump max depth |
||
244 | * |
||
245 | * @param int $maxDepth |
||
246 | * @return $this |
||
247 | */ |
||
248 | public function setMaxDepth($maxDepth) |
||
253 | |||
254 | /** |
||
255 | * Maximum length of a variable |
||
256 | * |
||
257 | * @param int $maxLen |
||
258 | * @return $this |
||
259 | */ |
||
260 | public function setMaxLen($maxLen) |
||
265 | } |
||
266 |