Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/routing/ |
Upload File : |
<?php /** * Bitrix Framework * @package bitrix * @subpackage main * @copyright 2001-2020 Bitrix */ namespace Bitrix\Main\Routing; use Bitrix\Main\Data\Cache; /** * @package bitrix * @subpackage main */ class CompileCache { /** * @param string[] $files * @param Router $router */ public static function handle($files, $router) { $cacheKeyElements = []; foreach ($files as $file) { $cacheKeyElements[] = $file.':'.filemtime($file); } $cacheKey = 'compiled_'.md5(join(',', $cacheKeyElements)); $cacheDir = 'routing'; $cache = Cache::createInstance(); if ($cache->initCache(3600*24*365, $cacheKey, $cacheDir)) { $cacheData = $cache->getVars(); } if (empty($cacheData)) { // compile all the routes $cacheData = []; foreach ($router->getRoutes() as $k => $route) { $cacheData[$k] = $route->getCompileCache(); } if ($cache->startDataCache()) { $cache->endDataCache($cacheData); } } else { // compile all the routes from cache foreach ($router->getRoutes() as $k => $route) { $route->compileFromCache($cacheData[$k]); } } } }