Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
config.php
1
<?php
2
3
namespace
Bitrix\MobileApp\Janative\Entity
;
4
5
use
Bitrix\Main\IO\File
;
6
use
Bitrix\Main\IO\Path
;
7
12
class
Config
13
{
14
private
?
string
$path;
15
private
array $config = [];
16
17
public
function
__construct
($path)
18
{
19
$this->path =
Path::normalize
($path);
20
$file =
new
File
($this->path);
21
if
($file->isExists())
22
{
23
$content = include($this->path);
24
25
if
(is_array($content))
26
{
27
$this->config = $content;
28
}
29
}
30
}
31
32
public
function
__get
($name)
33
{
34
$config = $this->config;
35
if
($name ==
"extensions"
)
36
{
37
if
(array_keys($config) !== range(0, count($config) - 1) && array_key_exists(
'extensions'
, $config))
38
{
39
return
$config[
'extensions'
];
40
}
41
else
42
{
43
return
[];
44
}
45
}
46
elseif ($name ==
"dynamicData"
)
47
{
48
return
$config[
'dynamicData'
] ?? [];
49
}
50
}
51
}
Bitrix\Main\IO\File
Definition
file.php:7
Bitrix\Main\IO\Path
Definition
path.php:11
Bitrix\Main\IO\Path\normalize
static normalize($path)
Definition
path.php:26
Bitrix\MobileApp\Janative\Entity\Config\__construct
__construct($path)
Definition
config.php:17
Bitrix\MobileApp\Janative\Entity\Config\__get
__get($name)
Definition
config.php:32
Bitrix\Main\Config
Definition
configuration.php:2
Bitrix\MobileApp\Janative\Entity
Definition
base.php:3
modules
mobileapp
lib
janative
entity
config.php
Создано системой
1.10.0