25 $cacheKeyElements = [];
27 foreach ($files as $file)
29 $cacheKeyElements[] = $file.
':'.filemtime($file);
32 $cacheKey =
'compiled_'.md5(join(
',', $cacheKeyElements));
33 $cacheDir =
'routing';
35 $cache = Cache::createInstance();
37 if ($cache->initCache(3600*24*365, $cacheKey, $cacheDir))
39 $cacheData = $cache->getVars();
42 if (empty($cacheData))
47 foreach (
$router->getRoutes() as $k => $route)
49 $cacheData[$k] = $route->getCompileCache();
52 if ($cache->startDataCache())
54 $cache->endDataCache($cacheData);
60 foreach (
$router->getRoutes() as $k => $route)
62 $route->compileFromCache($cacheData[$k]);