23 public static function remember(
string $cacheId,
int $ttl, callable $callback)
25 $cachePath = self::CACHE_ROOT .
'/' . $cacheId;
27 if ($manager->initCache($ttl, $cacheId, $cachePath))
29 $cached = $manager->getVars();
30 return $cached[
'PROXY'];
34 $result = $callback();
35 $manager->startDataCache();
36 $manager->endDataCache([
'PROXY' => $result]);