1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
utils.php
См. документацию.
1<?php
2
3namespace Bitrix\MobileApp\Janative;
4
5use Bitrix\Main\IO\File;
6use Bitrix\Main\Web\Json;
7
8class Utils
9{
10 protected static array $descriptionCache = [];
16 public static function extractEntityDescription($entityIdentifier, string $defaultNamespace = "bitrix"): array
17 {
18 $namespace = $defaultNamespace;
19 $name = $entityIdentifier;
20 $cacheId = "$namespace:$name";
21
22 if(!isset(self::$descriptionCache[$cacheId]))
23 {
24 if (strpos($entityIdentifier, ":"))
25 {
26 [$namespace, $name] = explode(":", $entityIdentifier);
27 }
28
29 self::$descriptionCache[$cacheId] = [
30 "name" => $name,
31 "namespace" => $namespace,
32 "fullname" => "$namespace:$name",
33 "relativePath" => "$namespace/$name",
34 "defaultFullname" => $namespace && $namespace != "bitrix" ? "$namespace:$name" : $name
35 ];
36 }
37
38 return self::$descriptionCache[$cacheId];
39 }
40
47 public static function jsonEncode($string, $options = JSON_HEX_TAG | JSON_HEX_AMP | JSON_PRETTY_PRINT | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE)
48 {
49 return Json::encode($string, $options);
50 }
51
52 public static function getFileHash(File $file) {
53 return filectime($file->getPhysicalPath()) ?? "";
54 }
55}
static getFileHash(File $file)
Определения utils.php:52
static array $descriptionCache
Определения utils.php:10
static extractEntityDescription($entityIdentifier, string $defaultNamespace="bitrix")
Определения utils.php:16
static jsonEncode($string, $options=JSON_HEX_TAG|JSON_HEX_AMP|JSON_PRETTY_PRINT|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_UNESCAPED_UNICODE)
Определения utils.php:47
$options
Определения commerceml2.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
Определения Image.php:9