initCache($ttl, $id, $dir)) { return $cache->getVars(); } $cache->startDataCache(); $taggedCache = Application::getInstance()->getTaggedCache(); $taggedCache->startTagCache($dir); try { foreach ($tags as $tag) { $taggedCache->registerTag($tag); } $value = $load(); } catch (\Throwable $e) { $taggedCache->abortTagCache(); $cache->abortDataCache(); throw $e; } $taggedCache->endTagCache(); $cache->endDataCache($value); return $value; } }