Skip to content

Commit cb0876e

Browse files
committed
Update D7 cache snippet
1 parent d332b46 commit cb0876e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

snippets/d7cache.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"prefix": "d7cachecode",
44
"body": [
55
"\\$cache = \\\\Bitrix\\\\Main\\\\Data\\\\Cache::createInstance();",
6-
"if (\\$cache->initCache(${1:7200}, ${2:\"cache_id\"}, ${3:\"cache_dir\"})) {",
7-
"\t\\$vars = \\$cache->getVars();",
6+
"if (\\$cache->initCache(${1:7200}, ${2:\"cache_id\"}, ${3:${4|\"cache_dir\",__CLASS__ . \"/\" . __FUNCTION__|}})) {",
7+
"\textract(\\$cache->getVars());",
88
"}",
99
"elseif (\\$cache->startDataCache()) {",
10-
"\t${4:${TM_SELECTED_TEXT://yourcode}}",
11-
"\t\\$cache->endDataCache(\\$vars);",
10+
"\t${5:${TM_SELECTED_TEXT://yourcode}}",
11+
"\t\\$cache->endDataCache(compact(\"vars\"));",
1212
"}"
1313
]
1414
}

0 commit comments

Comments
 (0)