1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
assets.php
См. документацию.
1<?php
2
4
5class Assets
6{
7 public $component = null;
8
9 private static $assetFiles = [
10 '/bitrix/components/bitrix/socialnetwork.log.ex/templates/.default/style.css',
11 ];
12
13 public function __construct($params)
14 {
15 if (!empty($params['component']))
16 {
17 $this->component = $params['component'];
18 }
19 }
20
21 public function getComponent()
22 {
23 return $this->component;
24 }
25
26 public function checkRefreshNeeded(&$result): bool
27 {
28 $params = $this->getComponent()->arParams;
29 if (empty($params['assetsCheckSum']))
30 {
31 return true;
32 }
33
34 $currentAssetsCheckSum = self::getCheckSum();
35 if (empty($currentAssetsCheckSum))
36 {
37 return true;
38 }
39
40 if ($currentAssetsCheckSum === $params['assetsCheckSum'])
41 {
42 return true;
43 }
44
45 $result['FORCE_PAGE_REFRESH'] = 'Y';
46
47 return false;
48 }
49
50 public function getAssetsCheckSum(&$result): void
51 {
52 $result['ASSETS_CHECKSUM'] = self::getCheckSum();
53 }
54
55 public static function getCheckSum()
56 {
57 static $result = null;
58
59 if ($result !== null)
60 {
61 return $result;
62 }
63
64 $assetsData = [];
65
67 foreach(self::$assetFiles as $filePath)
68 {
69 $file = new \Bitrix\Main\IO\File($documentRoot . $filePath);
70 if (!$file->isExists())
71 {
72 continue;
73 }
74
75 $assetsData[] = [
76 $filePath => $file->getModificationTime()
77 ];
78 }
79
80 return md5(serialize($assetsData));
81 }
82}
static getDocumentRoot()
Определения application.php:736
$result
Определения get_property_values.php:14
foreach(['Bitrix\\Main'=> '/lib', 'Psr\\Container'=> '/vendor/psr/container/src', 'Psr\\Log'=> '/vendor/psr/log/src', 'Psr\\Http\\Message'=> '/vendor/psr/http-message/src', 'Psr\\Http\\Client'=> '/vendor/psr/http-client/src', 'Http\\Promise'=> '/vendor/php-http/promise/src', 'PHPMailer\\PHPMailer'=> '/vendor/phpmailer/phpmailer/src', 'GeoIp2'=> '/vendor/geoip2/geoip2/src', 'MaxMind\\Db'=> '/vendor/maxmind-db/reader/src/MaxMind/Db', 'PhpParser'=> '/vendor/nikic/php-parser/lib/PhpParser', 'Recurr'=> '/vendor/simshaun/recurr/src/Recurr',] as $namespace=> $namespacePath) $documentRoot
Определения autoload.php:27
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799