Last active
August 5, 2019 14:37
-
-
Save 4yvi/4eb06a35310bd05ef2a6594c54cfe820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use \Bitrix\Main\Data\Cache; | |
$cache = Cache::createInstance(); // получаем экземпляр класса | |
if ($cache->initCache(7200, 'cache_key' . BX_CACHE_SID)) { // проверяем кеш и задаём настройки | |
$vars = $cache->getVars(); // достаем переменные из кеша | |
} | |
elseif ($cache->startDataCache()) { | |
// некоторые действия... | |
$cache->endDataCache(array('key' => 'value')); // записываем в кеш | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment