Skip to content

Commit

Permalink
Update D7 cache snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumanai committed Nov 20, 2019
1 parent d332b46 commit cb0876e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions snippets/d7cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"prefix": "d7cachecode",
"body": [
"\\$cache = \\\\Bitrix\\\\Main\\\\Data\\\\Cache::createInstance();",
"if (\\$cache->initCache(${1:7200}, ${2:\"cache_id\"}, ${3:\"cache_dir\"})) {",
"\t\\$vars = \\$cache->getVars();",
"if (\\$cache->initCache(${1:7200}, ${2:\"cache_id\"}, ${3:${4|\"cache_dir\",__CLASS__ . \"/\" . __FUNCTION__|}})) {",
"\textract(\\$cache->getVars());",
"}",
"elseif (\\$cache->startDataCache()) {",
"\t${4:${TM_SELECTED_TEXT://yourcode}}",
"\t\\$cache->endDataCache(\\$vars);",
"\t${5:${TM_SELECTED_TEXT://yourcode}}",
"\t\\$cache->endDataCache(compact(\"vars\"));",
"}"
]
}
Expand Down

0 comments on commit cb0876e

Please sign in to comment.