33use Bitrix \Main \Page \Asset ;
44
55$ ggrachDebuggerRootPath = str_replace ($ _SERVER ['DOCUMENT_ROOT ' ], '' , __DIR__ . '/.. ' );
6- $ ggrachPathLogFolder = \realpath ('. ' . $ ggrachDebuggerRootPath. '/logs ' );
6+ $ ggrachPathLogFolder = \realpath ('. ' . $ ggrachDebuggerRootPath . '/logs ' );
77
88\Bitrix \Main \Loader::registerAutoLoadClasses (null , [
9- "\GGrach\BitrixDebugger\Debugger\Debugger " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Debugger/Debugger.php " ,
10- "\GGrach\BitrixDebugger\Debugger\DebuggerShowModable " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Debugger/DebuggerShowModable.php " ,
11- "\GGrach\BitrixDebugger\Contract\ShowModableContract " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Contract/ShowModableContract.php " ,
12- "\GGrach\BitrixDebugger\Configurator\DebuggerConfigurator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Configurator/DebuggerConfigurator.php " ,
13- "\GGrach\BitrixDebugger\Configurator\DebugBarConfigurator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Configurator/DebugBarConfigurator.php " ,
14- "\GGrach\BitrixDebugger\Cache\RuntimeCache " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Cache/RuntimeCache.php " ,
15- "\GGrach\BitrixDebugger\Validator\ShowModeDebuggerValidator " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Validator/ShowModeDebuggerValidator.php " ,
16- "\GGrach\BitrixDebugger\Representer\DebugBarRepresenter " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Representer/DebugBarRepresenter.php " ,
17- "\GGrach\Writer\FileWriter " => $ ggrachDebuggerRootPath . "/src/Writer/FileWriter.php " ,
18- "\GGrach\Writer\Contract\WritableContract " => $ ggrachDebuggerRootPath . "/src/Writer/Contract/WritableContract.php " ,
19- "\GGrach\BitrixDebugger\Events\OnEndBufferContent " => $ ggrachDebuggerRootPath . "/src/BitrixDebugger/Events/OnEndBufferContent.php "
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 "
2022]);
2123
2224$ ggrachDebuggerConfigurator = new \GGrach \BitrixDebugger \Configurator \DebuggerConfigurator ();
2325$ ggrachDebugBarConfigurator = new \GGrach \BitrixDebugger \Configurator \DebugBarConfigurator ();
2426
25- $ ggrachDebuggerConfigurator ->setLogPath ('error ' , $ ggrachPathLogFolder . '/error.log ' );
26- $ ggrachDebuggerConfigurator ->setLogPath ('warning ' , $ ggrachPathLogFolder . '/warning.log ' );
27- $ ggrachDebuggerConfigurator ->setLogPath ('success ' , $ ggrachPathLogFolder . '/success.log ' );
28- $ ggrachDebuggerConfigurator ->setLogPath ('notice ' , $ ggrachPathLogFolder . '/notice.log ' );
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 ' );
2931
3032$ GLOBALS ["DD " ] = new \GGrach \BitrixDebugger \Debugger \Debugger ($ ggrachDebuggerConfigurator , $ ggrachDebugBarConfigurator );
3133
3234/*
3335 * code - отображать дебаг-данные в коде
3436 * debug_bar - отображать дебаг-данные в debug_bar
3537 */
36- $ GLOBALS ["DD " ]->setShowModes (['debug_bar ' ]);
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+ }
3746
38- function DD () {
3947 return $ GLOBALS ["DD " ];
4048}
4149
42- if (\GGrach \BitrixDebugger \Validator \ShowModeDebuggerValidator::needShowInDebugBar ($ GLOBALS ["DD " ])) {
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+ );
4361
44- Asset::getInstance ()->addJs ($ ggrachDebuggerRootPath . "/assets/DebugBar/js/initializer.js " );
45- Asset::getInstance ()->addCss ($ ggrachDebuggerRootPath . '/assets/DebugBar/css/themes/general.css ' );
46- Asset::getInstance ()->addCss ($ ggrachDebuggerRootPath . '/assets/DebugBar/css/themes/ ' . $ ggrachDebugBarConfigurator ->getColorTheme () . '/theme.css ' );
47-
48- include __DIR__ .'/../functions.php ' ;
49- include __DIR__ .'/../events.php ' ;
62+ include __DIR__ . '/../module/ggrachdev.debugbar/functions.php ' ;
63+ include __DIR__ . '/../module/ggrachdev.debugbar/events.php ' ;
5064}
0 commit comments