1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
compilecache.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Main\Routing
;
10
11
use
Bitrix\Main\Data\Cache
;
12
17
class
CompileCache
18
{
23
public
static
function
handle
(
$files
,
$router
)
24
{
25
$cacheKeyElements = [];
26
27
foreach
(
$files
as $file)
28
{
29
$cacheKeyElements[] = $file.
':'
.filemtime($file);
30
}
31
32
$cacheKey =
'compiled_'
.md5(join(
','
, $cacheKeyElements));
33
$cacheDir =
'routing'
;
34
35
$cache = Cache::createInstance();
36
37
if
($cache->initCache(3600*24*365, $cacheKey, $cacheDir))
38
{
39
$cacheData = $cache->getVars();
40
}
41
42
if
(empty($cacheData))
43
{
44
// compile all the routes
45
$cacheData = [];
46
47
foreach
(
$router
->getRoutes() as
$k
=>
$route
)
48
{
49
$cacheData[
$k
] =
$route
->getCompileCache();
50
}
51
52
if
($cache->startDataCache())
53
{
54
$cache->endDataCache($cacheData);
55
}
56
}
57
else
58
{
59
// compile all the routes from cache
60
foreach
(
$router
->getRoutes() as
$k
=>
$route
)
61
{
62
$route
->compileFromCache($cacheData[
$k
]);
63
}
64
}
65
}
66
}
Bitrix\Main\Routing\CompileCache
Определения
compilecache.php:18
Bitrix\Main\Routing\CompileCache\handle
static handle($files, $router)
Определения
compilecache.php:23
Bitrix\Main\Data\Cache
Определения
keyvalueengine.php:3
Bitrix\Main\Routing
Определения
compilecache.php:9
Bitrix\Main\$files
$files
Определения
mysql_to_pgsql.php:30
$router
$router
Определения
routing_index.php:31
$route
$route
Определения
routing_index.php:35
$k
$k
Определения
template_pdf.php:567
bitrix
modules
main
lib
routing
compilecache.php
Создано системой
1.14.0