11<?
2-
3- use Bitrix \Main \Page \Asset ;
4-
5- $ ggrachDebuggerRootPath = str_replace ($ _SERVER ['DOCUMENT_ROOT ' ], '' , __DIR__ . '/.. ' );
6- $ ggrachPathLogFolder = \realpath ('. ' . $ ggrachDebuggerRootPath . '/logs ' );
7-
8- \Bitrix \Main \Loader::registerAutoLoadClasses (null , [
9- "\GGrach\BitrixDebugger\Debugger\Debugger " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Debugger/Debugger.php " ,
10- "\GGrach\BitrixDebugger\Debugger\NoticeDebugger " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Debugger/NoticeDebugger.php " ,
11- "\GGrach\BitrixDebugger\Debugger\LogFileDebugger " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Debugger/LogFileDebugger.php " ,
12- "\GGrach\BitrixDebugger\Debugger\ConfigurationDebugger " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Debugger/ConfigurationDebugger.php " ,
13- "\GGrach\BitrixDebugger\Contract\ShowModableContract " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Contract/ShowModableContract.php " ,
14- "\GGrach\BitrixDebugger\Configurator\DebuggerConfigurator " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Configurator/DebuggerConfigurator.php " ,
15- "\GGrach\BitrixDebugger\Configurator\DebugBarConfigurator " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Configurator/DebugBarConfigurator.php " ,
16- "\GGrach\BitrixDebugger\Cache\RuntimeCache " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Cache/RuntimeCache.php " ,
17- "\GGrach\BitrixDebugger\Validator\ShowModeDebuggerValidator " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Validator/ShowModeDebuggerValidator.php " ,
18- "\GGrach\BitrixDebugger\Representer\DebugBarRepresenter " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Representer/DebugBarRepresenter.php " ,
19- "\GGrach\Writer\FileWriter " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/Writer/FileWriter.php " ,
20- "\GGrach\Writer\Contract\WritableContract " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/Writer/Contract/WritableContract.php " ,
21- "\GGrach\BitrixDebugger\Events\OnEndBufferContent " => $ ggrachDebuggerRootPath . "/module/ggrachdev.debugbar/classes/general/BitrixDebugger/Events/OnEndBufferContent.php "
22- ]);
23-
24- $ ggrachDebuggerConfigurator = new \GGrach \BitrixDebugger \Configurator \DebuggerConfigurator ();
25- $ ggrachDebugBarConfigurator = new \GGrach \BitrixDebugger \Configurator \DebugBarConfigurator ();
26-
27- $ ggrachDebuggerConfigurator ->setLogPath ('error ' , $ ggrachPathLogFolder . '/error.log ' )
28- ->setLogPath ('warning ' , $ ggrachPathLogFolder . '/warning.log ' )
29- ->setLogPath ('success ' , $ ggrachPathLogFolder . '/success.log ' )
30- ->setLogPath ('notice ' , $ ggrachPathLogFolder . '/notice.log ' );
31-
32- $ GLOBALS ["DD " ] = new \GGrach \BitrixDebugger \Debugger \Debugger ($ ggrachDebuggerConfigurator , $ ggrachDebugBarConfigurator );
33-
34- /*
35- * code - отображать дебаг-данные в коде
36- * debug_bar - отображать дебаг-данные в debug_bar
37- */
38- $ GLOBALS ["DD " ]->getConfiguratorDebugger ()->setShowModes (['debug_bar ' ]);
39-
40- function DD (...$ data ) {
41- if (!empty ($ data )) {
42- foreach ($ data as $ item ) {
43- $ GLOBALS ["DD " ]->notice ($ item );
44- }
45- }
46-
47- return $ GLOBALS ["DD " ];
48- }
49-
50- if (\GGrach \BitrixDebugger \Validator \ShowModeDebuggerValidator::needShowInDebugBar (DD ()->getConfiguratorDebugger ())) {
51-
52- Asset::getInstance ()->addJs (
53- $ ggrachDebuggerRootPath . '/module/ggrachdev.debugbar/install/js/initializer.js '
54- );
55- Asset::getInstance ()->addCss (
56- $ ggrachDebuggerRootPath . '/module/ggrachdev.debugbar/install/css/general.css '
57- );
58- Asset::getInstance ()->addCss (
59- $ ggrachDebuggerRootPath . '/module/ggrachdev.debugbar/install/css/ ' . $ ggrachDebugBarConfigurator ->getColorTheme () . '/theme.css '
60- );
61-
62- include __DIR__ . '/../module/ggrachdev.debugbar/functions.php ' ;
63- include __DIR__ . '/../module/ggrachdev.debugbar/events.php ' ;
64- }
2+ include __DIR__ . '/../module/ggrachdev.debugbar/include.php ' ;
0 commit comments