Skip to content

Commit ac6db37

Browse files
committed
Add debug
1 parent 6022cd5 commit ac6db37

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
"language": "php",
8080
"path": "./snippets/d7config.json"
8181
},
82+
{
83+
"language": "php",
84+
"path": "./snippets/d7debug.json"
85+
},
8286
{
8387
"language": "php",
8488
"path": "./snippets/d7element.json"

snippets/d7debug.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"D7Debug.write": {
3+
"prefix": "d7debugWrite",
4+
"body": [
5+
"Bitrix\\\\Main\\\\Diag\\\\Debug::writeToFile(array('${1:\\$varname}' => ${1:\\$varname}), \"\", \"${2:filename}.txt\");",
6+
"$0"
7+
],
8+
"description": "Печать переменных в файл. Использует print_r."
9+
},
10+
"D7Debug.dump": {
11+
"prefix": "d7debugDump",
12+
"body": [
13+
"Bitrix\\\\Main\\\\Diag\\\\Debug::dumpToFile(array('${1:\\$varname}' => ${1:\\$varname}), \"\", \"${2:filename}.txt\");",
14+
"$0"
15+
],
16+
"description": "Печать переменных в файл. Использует var_dump."
17+
},
18+
"D7Debug.startTime": {
19+
"prefix": "d7debugStartTime",
20+
"body": [
21+
"Bitrix\\\\Main\\\\Diag\\\\Debug::startTimeLabel(\"${1:label}\");",
22+
"$0"
23+
],
24+
"description": "Устанавливает метку начала отслеживания времени выполнения фрагмента кода."
25+
},
26+
"D7Debug.endTime": {
27+
"prefix": "d7debugEndTime",
28+
"body": [
29+
"Bitrix\\\\Main\\\\Diag\\\\Debug::endTimeLabel(\"${1:label}\");",
30+
"$0"
31+
],
32+
"description": "Устанавливает метку окончания отслеживания времени выполнения фрагмента кода."
33+
},
34+
"D7Debug.getTime": {
35+
"prefix": "d7debugGetTime",
36+
"body": [
37+
"Bitrix\\\\Main\\\\Diag\\\\Debug::getTimeLabels();",
38+
"$0"
39+
],
40+
"description": "Вывод массива пользовательских меток выполнения фрагментов кода."
41+
},
42+
"D7Debug.time": {
43+
"prefix": "d7debugTime",
44+
"body": [
45+
"Bitrix\\\\Main\\\\Diag\\\\Debug::startTimeLabel(\"${1:label}\");",
46+
"${TM_SELECTED_TEXT://yourcode}",
47+
"Bitrix\\\\Main\\\\Diag\\\\Debug::endTimeLabel(\"${1:label}\");",
48+
"Bitrix\\\\Main\\\\Diag\\\\Debug::getTimeLabels();",
49+
"$0"
50+
],
51+
"description": "Замер времени выполнения выделенного фрагмента кода."
52+
}
53+
}

0 commit comments

Comments
 (0)