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 string |
||
38 | */ |
||
39 | protected $barTitle; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $barInfo = []; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $barPanels = [ |
||
50 | 'WebinoDebug:info' => Debugger\InfoPanel::class, |
||
51 | 'WebinoDebug:timer' => Debugger\TimerPanel::class, |
||
52 | 'WebinoDebug:config' => Debugger\ConfigPanel::class, |
||
53 | 'WebinoDebug:services' => Debugger\ServicesPanel::class, |
||
54 | 'WebinoDebug:events' => Debugger\EventPanel::class, |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $cssFiles = [__DIR__ . '/../../../data/assets/Debugger/style.css']; |
||
61 | |||
62 | /** |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $jsFiles = [__DIR__ . '/../../../data/assets/Debugger/script.js']; |
||
66 | |||
67 | /** |
||
68 | * @var int |
||
69 | */ |
||
70 | protected $strict = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_USER_NOTICE; |
||
71 | |||
72 | /** |
||
73 | * @var string|null |
||
74 | */ |
||
75 | protected $log; |
||
76 | |||
77 | /** |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $email = ''; |
||
81 | |||
82 | /** |
||
83 | * @var int |
||
84 | */ |
||
85 | protected $maxDepth = 10; |
||
86 | |||
87 | /** |
||
88 | * @var int |
||
89 | */ |
||
90 | protected $maxLength = 300; |
||
91 | |||
92 | /** |
||
93 | * @var bool |
||
94 | */ |
||
95 | protected $barNoLogo = false; |
||
96 | |||
97 | /** |
||
98 | * @var bool |
||
99 | */ |
||
100 | protected $barNoClose = false; |
||
101 | |||
102 | /** |
||
103 | * @var bool |
||
104 | */ |
||
105 | protected $fireLogger = false; |
||
106 | |||
107 | /** |
||
108 | * Is debugger enabled? |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | public function isEnabled(): bool |
||
116 | |||
117 | /** |
||
118 | * Enable debugger |
||
119 | * |
||
120 | * @param bool $enabled |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function setEnabled($enabled = true) |
||
128 | |||
129 | /** |
||
130 | * Is debugger disabled? |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function isDisabled(): bool |
||
138 | |||
139 | /** |
||
140 | * Debugger mode |
||
141 | * |
||
142 | * true = production|false |
||
143 | * false = development|null |
||
144 | * null = autodetect|IP address(es) csv/array |
||
145 | * |
||
146 | * @return bool|null |
||
147 | */ |
||
148 | public function getMode(): ?bool |
||
152 | |||
153 | /** |
||
154 | * Debugger mode, production or development. |
||
155 | * |
||
156 | * @param bool|null $mode |
||
157 | * @return $this |
||
158 | */ |
||
159 | public function setMode($mode) |
||
164 | |||
165 | /** |
||
166 | * Is debugger bar enabled? |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | public function hasBar(): bool |
||
174 | |||
175 | /** |
||
176 | * Toggle debugger bar |
||
177 | * |
||
178 | * @param bool $bar |
||
179 | * @return $this |
||
180 | */ |
||
181 | public function setBar($bar) |
||
186 | |||
187 | /** |
||
188 | * Debugger bar panels |
||
189 | * |
||
190 | * @return array |
||
191 | */ |
||
192 | public function getBarPanels(): array |
||
196 | |||
197 | /** |
||
198 | * Set custom debugger bar panels |
||
199 | * |
||
200 | * @param array $barPanels |
||
201 | * @return $this |
||
202 | */ |
||
203 | public function setBarPanels(array $barPanels) |
||
208 | |||
209 | /** |
||
210 | * @return array |
||
211 | */ |
||
212 | public function getCssFiles(): array |
||
216 | |||
217 | /** |
||
218 | * Set custom CSS files |
||
219 | * |
||
220 | * @param array $cssFiles |
||
221 | * @return $this |
||
222 | */ |
||
223 | public function setCssFiles(array $cssFiles) |
||
228 | |||
229 | /** |
||
230 | * @return array |
||
231 | */ |
||
232 | public function getJsFiles(): array |
||
236 | |||
237 | /** |
||
238 | * Set custom Javascript files |
||
239 | * |
||
240 | * @param array $jsFiles |
||
241 | * @return $this |
||
242 | */ |
||
243 | public function setJsFiles(array $jsFiles) |
||
248 | |||
249 | /** |
||
250 | * Return custom debugger bar info |
||
251 | * |
||
252 | * @return array |
||
253 | */ |
||
254 | public function getBarInfo(): array |
||
258 | |||
259 | /** |
||
260 | * Set custom debugger bar info |
||
261 | * |
||
262 | * @param array $barInfo |
||
263 | * @return $this |
||
264 | */ |
||
265 | public function setBarInfo(array $barInfo) |
||
270 | |||
271 | /** |
||
272 | * Error reporting level |
||
273 | * |
||
274 | * @return int |
||
275 | */ |
||
276 | public function getStrict(): int |
||
280 | |||
281 | /** |
||
282 | * Set error reporting level |
||
283 | * |
||
284 | * @param int $strict |
||
285 | * @return $this |
||
286 | */ |
||
287 | public function setStrict($strict) |
||
292 | |||
293 | /** |
||
294 | * @return string Empty string to disable, null for default |
||
295 | */ |
||
296 | public function getLog(): string |
||
303 | |||
304 | /** |
||
305 | * Path to log directory |
||
306 | * |
||
307 | * @param string $log |
||
308 | * @return $this |
||
309 | */ |
||
310 | public function setLog($log) |
||
315 | |||
316 | /** |
||
317 | * Administrator address |
||
318 | * |
||
319 | * @return string |
||
320 | */ |
||
321 | public function getEmail(): string |
||
325 | |||
326 | /** |
||
327 | * Configure debugger administrator email |
||
328 | * |
||
329 | * @param string $email |
||
330 | * @return $this |
||
331 | */ |
||
332 | public function setEmail($email) |
||
337 | |||
338 | /** |
||
339 | * @return int |
||
340 | */ |
||
341 | public function getMaxDepth(): int |
||
345 | |||
346 | /** |
||
347 | * Variable dump max depth |
||
348 | * |
||
349 | * @param int $maxDepth |
||
350 | * @return $this |
||
351 | */ |
||
352 | public function setMaxDepth($maxDepth) |
||
357 | |||
358 | /** |
||
359 | * @return int |
||
360 | */ |
||
361 | public function getMaxLength(): int |
||
365 | |||
366 | /** |
||
367 | * Maximum length of a variable |
||
368 | * |
||
369 | * @param int $maxLength |
||
370 | * @return $this |
||
371 | */ |
||
372 | public function setMaxLength($maxLength) |
||
377 | |||
378 | /** |
||
379 | * Return debugger bar title |
||
380 | * |
||
381 | * @return string |
||
382 | */ |
||
383 | public function getBarTitle(): string |
||
387 | |||
388 | /** |
||
389 | * Set debugger bar custom title |
||
390 | * |
||
391 | * @param string $barTitle |
||
392 | * @return $this |
||
393 | */ |
||
394 | public function setBarTitle($barTitle) |
||
399 | |||
400 | /** |
||
401 | * Has debugger bar a disabled logo? |
||
402 | * |
||
403 | * @return bool |
||
404 | */ |
||
405 | public function hasBarNoLogo(): bool |
||
409 | |||
410 | /** |
||
411 | * Set debugger bar logo disabled |
||
412 | * |
||
413 | * @param bool $barNoLogo |
||
414 | * @return $this |
||
415 | */ |
||
416 | public function setBarNoLogo($barNoLogo = true) |
||
421 | |||
422 | /** |
||
423 | * Has debugger bar close button disabled? |
||
424 | * |
||
425 | * @return bool |
||
426 | */ |
||
427 | public function hasBarNoClose(): bool |
||
431 | |||
432 | /** |
||
433 | * Disable debugger bar close button |
||
434 | * |
||
435 | * @param bool $barNoClose |
||
436 | * @return $this |
||
437 | */ |
||
438 | public function setBarNoClose($barNoClose = true) |
||
443 | |||
444 | /** |
||
445 | * Is fire logger enabled? |
||
446 | * |
||
447 | * @return bool |
||
448 | */ |
||
449 | public function hasFireLogger(): bool |
||
453 | |||
454 | /** |
||
455 | * Use fire logger |
||
456 | * |
||
457 | * @param bool $fireLogger |
||
458 | * @return $this |
||
459 | */ |
||
460 | public function setFireLogger($fireLogger = true) |
||
465 | } |
||
466 |