2222 * include 'BitrixDebugger/initializer.php';
2323 *
2424 */
25- use Bitrix \Main \Page \Asset ;
26-
27- if (\php_sapi_name () !== 'cli ' ) {
28-
29- $ ggrachDebuggerRootPath = str_replace ($ _SERVER ['DOCUMENT_ROOT ' ], '' , __DIR__ );
30-
31- \Bitrix \Main \Loader::registerAutoLoadClasses (null , [
32- "\GGrach\BitrixDebugger\Debugger\Debugger " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Debugger/Debugger.php " ,
33- "\GGrach\BitrixDebugger\Debugger\DebuggerShowModable " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Debugger/DebuggerShowModable.php " ,
34- "\GGrach\BitrixDebugger\Contract\ShowModableContract " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Contract/ShowModableContract.php " ,
35- "\GGrach\BitrixDebugger\Configurator\DebuggerConfigurator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Configurator/DebuggerConfigurator.php " ,
36- "\GGrach\BitrixDebugger\Configurator\DebugBarConfigurator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Configurator/DebugBarConfigurator.php " ,
37- "\GGrach\BitrixDebugger\Cache\RuntimeCache " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Cache/RuntimeCache.php " ,
38- "\GGrach\BitrixDebugger\Validator\ShowModeDebuggerValidator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Validator/ShowModeDebuggerValidator.php " ,
39- "\GGrach\BitrixDebugger\Representer\DebugBarRepresenter " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Representer/DebugBarRepresenter.php " ,
40- "\GGrach\Writer\FileWriter " => $ ggrachDebuggerRootPath . "/src/Writer/FileWriter.php " ,
41- "\GGrach\Writer\Contract\WritableContract " => $ ggrachDebuggerRootPath . "/src/Writer/Contract/WritableContract.php "
42- ]);
43-
44- $ ggrachDebuggerConfigurator = new \GGrach \BitrixDebugger \Configurator \DebuggerConfigurator ();
45- $ ggrachDebugBarConfigurator = new \GGrach \BitrixDebugger \Configurator \DebugBarConfigurator ();
46-
47- $ ggrachDebuggerConfigurator ->setLogPath ('error ' , __DIR__ . '/logs/error.log ' );
48- $ ggrachDebuggerConfigurator ->setLogPath ('warning ' , __DIR__ . '/logs/warning.log ' );
49- $ ggrachDebuggerConfigurator ->setLogPath ('success ' , __DIR__ . '/logs/success.log ' );
50- $ ggrachDebuggerConfigurator ->setLogPath ('notice ' , __DIR__ . '/logs/notice.log ' );
51-
52- $ GLOBALS ["DD " ] = new \GGrach \BitrixDebugger \Debugger \Debugger ($ ggrachDebuggerConfigurator , $ ggrachDebugBarConfigurator );
53-
54- /*
55- * code - отображать дебаг-данные в коде
56- * debug_bar - отображать дебаг-данные в debug_bar
57- */
58- $ GLOBALS ["DD " ]->setShowModes (['code ' , 'debug_bar ' ]);
59-
60- function DD () {
61- return $ GLOBALS ["DD " ];
62- }
63-
64- if (\GGrach \BitrixDebugger \Validator \ShowModeDebuggerValidator::needShowInDebugBar ($ GLOBALS ["DD " ])) {
65-
66- Asset::getInstance ()->addJs ($ ggrachDebuggerRootPath . "/assets/DebugBar/js/initializer.js " );
67- Asset::getInstance ()->addCss ($ ggrachDebuggerRootPath . '/assets/DebugBar/css/themes/general.css ' );
68- Asset::getInstance ()->addCss ($ ggrachDebuggerRootPath . '/assets/DebugBar/css/themes/ ' . $ ggrachDebugBarConfigurator ->getColorTheme () . '/theme.css ' );
69-
70- include 'functions.php ' ;
71-
72- include 'events.php ' ;
73- }
25+ if (\php_sapi_name () === 'cli ' ) {
26+ include 'initializers/cli.php ' ;
27+ } else {
28+ include 'initializers/server.php ' ;
7429}
0 commit comments