Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
debug.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\debug;
15
16 use Symfony\Component\Debug\BufferingLogger;
17 use Symfony\Component\Debug\DebugClassLoader;
18 use Symfony\Component\Debug\ExceptionHandler;
19
20 /**
21 * Registers all the debug tools.
22
23 * @see Symfony\Component\Debug\Debug
24 */
25 class debug
26 {
27 static private $enabled = false;
28
29 /**
30 * Enables the debug tools.
31 *
32 * This method registers an error handler and an exception handler.
33 *
34 * If the Symfony ClassLoader component is available, a special
35 * class loader is also registered.
36 *
37 * @param int $errorReportingLevel The level of error reporting you want
38 * @param bool $displayErrors Whether to display errors (for development) or just log them (for production)
39 */
40 static public function enable($errorReportingLevel = null, $displayErrors = true)
41 {
42 if (static::$enabled)
43 {
44 return;
45 }
46
47 static::$enabled = true;
48
49 if ($errorReportingLevel !== null)
50 {
51 error_reporting($errorReportingLevel);
52 }
53 else
54 {
55 error_reporting(-1);
56 }
57
58 if ('cli' !== php_sapi_name())
59 {
60 ini_set('display_errors', 0);
61 ExceptionHandler::register();
62 }
63 else if ($displayErrors && (!ini_get('log_errors') || ini_get('error_log')))
64 {
65 // CLI - display errors only if they're not already logged to STDERR
66 ini_set('display_errors', 1);
67 }
68
69 if ($displayErrors)
70 {
71 error_handler::register(new error_handler(new BufferingLogger()));
72 }
73 else
74 {
75 error_handler::register()->throwAt(0, true);
76 }
77
78 DebugClassLoader::enable();
79 }
80 }
81