1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
debuginfo.php
См. документацию.
1
<?php
2
8
9
use
Bitrix\Main\Data\Cache
;
10
use
Bitrix\Main\Application
;
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Main\Diag\CacheTracker
;
13
14
IncludeModuleLangFile
(__FILE__);
15
16
class
CDebugInfo
17
{
18
var
$start_time
;
20
var
$savedTracker
=
null
;
21
var
$cache_size
= 0;
22
var
$arCacheDebugSave
;
23
var
$arResult
;
24
static
$level
= 0;
25
var
$is_comp
=
true
;
26
var
$index
= 0;
27
28
public
function
__construct
(
$is_comp
=
true
)
29
{
30
$this->is_comp =
$is_comp
;
31
}
32
33
public
function
Start
()
34
{
35
global
$APPLICATION
;
36
global
$DB
;
37
global $CACHE_STAT_BYTES;
38
39
if
($this->is_comp)
40
{
41
self::$level++;
42
}
43
44
$this->start_time = microtime(
true
);
45
if
(
$DB
->ShowSqlStat)
46
{
47
$application
=
Application::getInstance
();
48
$connection
=
$application
->getConnection();
49
$this->savedTracker =
$application
->getConnection()->getTracker();
50
51
$connection
->setTracker(
null
);
52
$connection
->startTracker();
53
$DB
->sqlTracker =
$connection
->getTracker();
54
}
55
56
if
(Cache::getShowCacheStat())
57
{
58
$this->arCacheDebugSave =
CacheTracker::getCacheTracking
();
59
CacheTracker::setCacheTracking
([]);
60
$this->cache_size =
CacheTracker::getCacheStatBytes
();
61
CacheTracker::setCacheStatBytes
($CACHE_STAT_BYTES = 0);
62
}
63
$this->arResult = [];
64
$this->index =
count
(
$APPLICATION
->arIncludeDebug);
65
$APPLICATION
->arIncludeDebug[
$this->index
] = &
$this->arResult
;
66
}
67
68
public
function
Stop
($rel_path =
""
,
$path
=
""
, $cache_type =
""
)
69
{
70
global
$DB
;
71
global $CACHE_STAT_BYTES;
72
73
if
($this->is_comp)
74
{
75
self::$level--;
76
}
77
78
$this->arResult = [
79
"PATH"
=>
$path
,
80
"REL_PATH"
=> $rel_path,
81
"QUERY_COUNT"
=> 0,
82
"QUERY_TIME"
=> 0,
83
"QUERIES"
=> [],
84
"TIME"
=> (microtime(
true
) -
$this->start_time
),
85
"BX_STATE"
=>
$GLOBALS
[
"BX_STATE"
],
86
"CACHE_TYPE"
=> $cache_type,
87
"CACHE_SIZE"
=> Cache::getShowCacheStat() ?
CacheTracker::getCacheStatBytes
() : 0,
88
"LEVEL"
=> self::$level,
89
];
90
91
if
($this->savedTracker)
92
{
93
$application
=
Application::getInstance
();
94
$connection
=
$application
->getConnection();
95
$sqlTracker
=
$connection
->getTracker();
96
97
if
(
$sqlTracker
->getCounter() > 0)
98
{
99
$this->arResult[
"QUERY_COUNT"
] =
$sqlTracker
->getCounter();
100
$this->arResult[
"QUERY_TIME"
] =
$sqlTracker
->getTime();
101
$this->arResult[
"QUERIES"
] =
$sqlTracker
->getQueries();
102
}
103
104
$connection
->setTracker($this->savedTracker);
105
$DB
->sqlTracker =
$connection
->getTracker();
106
$this->savedTracker =
null
;
107
}
108
109
if
(Cache::getShowCacheStat())
110
{
111
$this->arResult[
"CACHE"
] =
CacheTracker::getCacheTracking
();
112
CacheTracker::setCacheTracking
($this->arCacheDebugSave);
113
CacheTracker::setCacheStatBytes
($CACHE_STAT_BYTES = $this->cache_size);
114
}
115
}
116
117
public
function
Output
($rel_path =
""
,
$path
=
""
, $cache_type =
""
)
118
{
119
$this->
Stop
($rel_path,
$path
, $cache_type);
120
121
$result
=
'<div class="bx-component-debug">'
;
122
$result
.= ($rel_path <>
""
? $rel_path .
": "
:
""
) .
"<nobr>"
. round($this->arResult[
"TIME"
], 4)
123
.
" "
. Loc::getMessage(
"main_incl_file_sec"
).
"</nobr>"
;
124
125
if
($this->arResult[
"QUERY_COUNT"
])
126
{
127
$result
.=
'; <a title="'
. Loc::getMessage(
"main_incl_file_sql_stat"
) .
'" href="javascript:BX_DEBUG_INFO_'
128
. $this->index .
'.Show(); BX_DEBUG_INFO_'
. $this->index
129
.
'.ShowDetails(\'BX_DEBUG_INFO_'
. $this->index.
'_1\'); ">'
. Loc::getMessage(
"main_incl_file_sql"
)
130
.
' '
. ($this->arResult[
"QUERY_COUNT"
]) .
' ('
. round($this->arResult[
"QUERY_TIME"
], 4)
131
.
' '
. Loc::getMessage(
"main_incl_file_sec"
) .
')</a>'
;
132
}
133
134
if
($this->arResult[
"CACHE_SIZE"
])
135
{
136
if
($this->arResult[
"CACHE"
] && !empty($this->arResult[
"CACHE"
]))
137
{
138
$result
.=
'<nobr>; <a href="javascript:BX_DEBUG_INFO_CACHE_'
. $this->index
139
.
'.Show(); BX_DEBUG_INFO_CACHE_'
. $this->index .
'.ShowDetails(\'BX_DEBUG_INFO_CACHE_'
140
. $this->index .
'_0\');">'
. Loc::getMessage(
"main_incl_cache_stat"
) .
'</a> '
141
. CFile::FormatSize($this->arResult[
"CACHE_SIZE"
], 0) .
'</nobr>'
;
142
}
143
else
144
{
145
$result
.=
"<nobr>; "
. Loc::getMessage(
"main_incl_cache_stat"
) .
" "
146
. CFile::FormatSize($this->arResult[
"CACHE_SIZE"
], 0) .
"</nobr>"
;
147
}
148
}
149
150
return
$result
.
"</div>"
;
151
}
152
}
$path
$path
Определения
access_edit.php:21
$connection
$connection
Определения
actionsdefinitions.php:38
$APPLICATION
global $APPLICATION
Определения
include.php:80
Bitrix\Main\Application
Определения
application.php:30
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
Bitrix\Main\Diag\CacheTracker
Определения
cachetracker.php:6
Bitrix\Main\Diag\CacheTracker\getCacheStatBytes
static getCacheStatBytes()
Определения
cachetracker.php:38
Bitrix\Main\Diag\CacheTracker\getCacheTracking
static getCacheTracking()
Определения
cachetracker.php:121
Bitrix\Main\Diag\CacheTracker\setCacheTracking
static setCacheTracking($val)
Определения
cachetracker.php:126
Bitrix\Main\Diag\CacheTracker\setCacheStatBytes
static setCacheStatBytes($cacheStatBytes)
Определения
cachetracker.php:28
Bitrix\Main\Localization\Loc
Определения
loc.php:12
CDebugInfo
Определения
debuginfo.php:17
CDebugInfo\$arCacheDebugSave
$arCacheDebugSave
Определения
debuginfo.php:22
CDebugInfo\$arResult
$arResult
Определения
debuginfo.php:23
CDebugInfo\$index
$index
Определения
debuginfo.php:26
CDebugInfo\Stop
Stop($rel_path="", $path="", $cache_type="")
Определения
debuginfo.php:68
CDebugInfo\Output
Output($rel_path="", $path="", $cache_type="")
Определения
debuginfo.php:117
CDebugInfo\Start
Start()
Определения
debuginfo.php:33
CDebugInfo\$start_time
$start_time
Определения
debuginfo.php:18
CDebugInfo\__construct
__construct($is_comp=true)
Определения
debuginfo.php:28
CDebugInfo\$savedTracker
$savedTracker
Определения
debuginfo.php:20
CDebugInfo\$cache_size
$cache_size
Определения
debuginfo.php:21
CDebugInfo\$is_comp
$is_comp
Определения
debuginfo.php:25
CDebugInfo\$level
static $level
Определения
debuginfo.php:24
$sqlTracker
$sqlTracker
Определения
debug_info.php:28
$result
$result
Определения
get_property_values.php:14
$DB
global $DB
Определения
cron_frame.php:29
$application
$application
Определения
bitrix.php:23
IncludeModuleLangFile
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения
tools.php:3778
Bitrix\Main\Data\Cache
Определения
keyvalueengine.php:3
Bitrix\Main\$GLOBALS
$GLOBALS['____1690880296']
Определения
license.php:1
count
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения
waybill.php:936
bitrix
modules
main
classes
general
debuginfo.php
Создано системой
1.14.0