1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Configuration\DataProvider\Http
;
4
5
use
Bitrix\Main\SystemException
;
6
use
Bitrix\Main\LoaderException
;
7
use
Bitrix\Main\IO\File
;
8
use
Bitrix\Main\IO\FileNotFoundException
;
9
use
Bitrix\Rest\Configuration\DataProvider\ProviderBase
;
10
11
class
Base
extends
ProviderBase
12
{
18
public
function
__construct
(
array
$setting)
19
{
20
parent::__construct($setting);
21
}
22
26
public
function
set
()
27
{
28
throw
new
SystemException
(
29
'This method isn\'t supported'
,
30
'ERROR_METHOD'
31
);
32
}
33
40
public
function
get
(
$path
):
array
41
{
42
$result
=
null
;
43
if
(
$path
)
44
{
45
$fileInfo = \CFile::MakeFileArray(
$path
);
46
if
(is_array($fileInfo) && File::isFileExists($fileInfo[
'tmp_name'
]))
47
{
48
preg_match(
"/\/([a-zA-Z0-9_-]+)\.[a-zA-Z0-9_-]+$/"
,
$path
,
$matches
);
49
$name
=
$matches
[1] ??
null
;
50
51
$file =
new
File
($fileInfo[
'tmp_name'
]);
52
try
53
{
54
$result
= [
55
'DATA'
=> $file->getContents(),
56
'FILE_NAME'
=>
$name
,
57
];
58
}
59
catch
(
FileNotFoundException
$exception)
60
{
61
$result
=
null
;
62
}
63
}
64
}
65
66
return
$result
;
67
}
68
74
public
function
addFiles
(
array
$files
)
75
{
76
throw
new
SystemException
(
77
'This method isn\'t supported'
,
78
'ERROR_METHOD'
79
);
80
}
81
}
$path
$path
Определения
access_edit.php:21
Bitrix\Main\IO\FileNotFoundException
Определения
filenotfoundexception.php:6
Bitrix\Main\LoaderException
Определения
loader.php:659
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Rest\Configuration\DataProvider\Http\Base
Определения
base.php:12
Bitrix\Rest\Configuration\DataProvider\Http\Base\__construct
__construct(array $setting)
Определения
base.php:18
Bitrix\Rest\Configuration\DataProvider\Http\Base\addFiles
addFiles(array $files)
Определения
base.php:74
Bitrix\Rest\Configuration\DataProvider\ProviderBase
Определения
providerbase.php:15
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
$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\Http
Определения
base.php:3
$matches
$matches
Определения
index.php:22
bitrix
modules
rest
lib
configuration
dataprovider
http
base.php
Создано системой
1.14.0