1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Configuration\DataProvider\IO
;
4
5
use
Bitrix\Main\SystemException
;
6
use
Bitrix\Main\IO\File
;
7
use
Bitrix\Main\IO\FileNotFoundException
;
8
use
Bitrix\Rest\Configuration\DataProvider\ProviderBase
;
9
10
class
Base
extends
ProviderBase
11
{
17
public
function
__construct
(
array
$setting)
18
{
19
parent::__construct($setting);
20
}
21
25
public
function
addContent
(
string
$code
,
$content
,
$type
=
false
): bool
26
{
27
throw
new
SystemException
(
28
'This method isn\'t supported'
,
29
'ERROR_METHOD'
30
);
31
}
32
41
public
function
get
(
string
$path
,
int
$step): ?
array
42
{
43
$result
=
null
;
44
if
(
$path
)
45
{
46
$fileInfo = \CFile::MakeFileArray(
$path
);
47
if
(is_array($fileInfo) && $fileInfo[
'tmp_name'
] && File::isFileExists($fileInfo[
'tmp_name'
]))
48
{
49
preg_match(
"/\/([a-zA-Z0-9_-]+)\.[a-zA-Z0-9_-]+$/"
,
$path
,
$matches
);
50
$name
=
$matches
[1] ??
null
;
51
52
$file =
new
File
($fileInfo[
'tmp_name'
]);
53
try
54
{
55
$result
= [
56
'DATA'
=> $file->getContents(),
57
'FILE_NAME'
=>
$name
,
58
];
59
}
60
catch
(
FileNotFoundException
$exception)
61
{
62
$result
=
null
;
63
}
64
}
65
}
66
67
return
$result
;
68
}
69
75
public
function
addFiles
(
array
$files
):
array
76
{
77
throw
new
SystemException
(
78
'This method isn\'t supported'
,
79
'ERROR_METHOD'
80
);
81
}
82
}
$path
$path
Определения
access_edit.php:21
$type
$type
Определения
options.php:106
Bitrix\Main\IO\FileNotFoundException
Определения
filenotfoundexception.php:6
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Rest\Configuration\DataProvider\IO\Base
Определения
base.php:11
Bitrix\Rest\Configuration\DataProvider\IO\Base\addContent
addContent(string $code, $content, $type=false)
Определения
base.php:25
Bitrix\Rest\Configuration\DataProvider\IO\Base\__construct
__construct(array $setting)
Определения
base.php:17
Bitrix\Rest\Configuration\DataProvider\IO\Base\addFiles
addFiles(array $files)
Определения
base.php:75
Bitrix\Rest\Configuration\DataProvider\ProviderBase
Определения
providerbase.php:15
$content
$content
Определения
commerceml.php:144
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
$name
$name
Определения
menu_edit.php:35
Bitrix\Main\File
Определения
Image.php:9
Bitrix\Main\$files
$files
Определения
mysql_to_pgsql.php:30
Bitrix\Rest\Configuration\DataProvider\IO
Определения
base.php:3
$matches
$matches
Определения
index.php:22
bitrix
modules
rest
lib
configuration
dataprovider
io
base.php
Создано системой
1.14.0