1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
backup_bucket.php
См. документацию.
1
<?php
2
class
CBitrixCloudBackupBucket
extends
CCloudStorageBucket
3
{
4
private
$file_name =
''
;
5
private
$check_word =
''
;
6
18
public
function
__construct
($bucket_name, $prefix,
$access_key
, $secret_key, $session_token, $check_word, $file_name,
$location
=
''
, $service_id =
''
)
19
{
20
if
(!$service_id)
21
{
22
$service_id =
'amazon_s3'
;
23
}
24
25
parent::__construct(0);
26
$this->arBucket = [
27
'ACTIVE'
=>
'Y'
,
28
'SORT'
=> 0,
29
'READ_ONLY'
=>
'N'
,
30
'SERVICE_ID'
=> $service_id,
31
'BUCKET'
=> $bucket_name,
32
'LOCATION'
=> (string)
$location
,
33
'CNAME'
=>
''
,
34
'FILE_COUNT'
=> 0,
35
'FILE_SIZE'
=> 0,
36
'LAST_FILE_ID'
=> 0,
37
'PREFIX'
=> $prefix,
38
'SETTINGS'
=> [
39
'ACCESS_KEY'
=>
$access_key
,
40
'SECRET_KEY'
=> $secret_key,
41
'SESSION_TOKEN'
=> $session_token,
42
],
43
'FILE_RULES'
=>
'a:1:{i:0;a:3:{s:6:"MODULE";s:0:"";s:9:"EXTENSION";s:0:"";s:4:"SIZE";s:0:"";}}'
,
44
'FILE_RULES_COMPILED'
=> [
45
[
46
'MODULE_MASK'
=>
''
,
47
'EXTENTION_MASK'
=>
''
,
48
'SIZE_ARRAY'
=> [
49
],
50
],
51
],
52
];
53
$this->file_name = $file_name;
54
$this->check_word = $check_word;
55
}
56
62
public
function
getFileName
()
63
{
64
return
$this->
GetFileSRC
($this->file_name);
65
}
66
72
public
function
getHeaders()
73
{
75
$service
= $this->
getService
();
76
$headers =
$service
->SignRequest(
77
$this->arBucket[
'SETTINGS'
],
78
'GET'
,
79
$this->arBucket[
'BUCKET'
],
80
'/'
. $this->arBucket[
'PREFIX'
] .
'/'
. $this->file_name,
81
''
,
82
[
83
'x-amz-security-token'
=> $this->arBucket[
'SETTINGS'
][
'SESSION_TOKEN'
],
84
]
85
);
86
$headers[
'x-amz-security-token'
] = $this->arBucket[
'SETTINGS'
][
'SESSION_TOKEN'
];
87
return
$headers;
88
}
89
90
public
function
setPublic
($isPublic)
91
{
92
$this->service->SetPublic($isPublic);
93
}
94
95
public
function
unsetCheckWordHeader
()
96
{
97
$this->service->UnsetHeader(
'x-amz-meta-check-word'
);
98
}
99
100
public
function
setCheckWordHeader
()
101
{
102
$this->service->SetHeader(
'x-amz-meta-check-word'
, $this->check_word);
103
}
104
}
CBitrixCloudBackupBucket
Определения
backup_bucket.php:3
CBitrixCloudBackupBucket\setPublic
setPublic($isPublic)
Определения
backup_bucket.php:90
CBitrixCloudBackupBucket\__construct
__construct($bucket_name, $prefix, $access_key, $secret_key, $session_token, $check_word, $file_name, $location='', $service_id='')
Определения
backup_bucket.php:18
CBitrixCloudBackupBucket\setCheckWordHeader
setCheckWordHeader()
Определения
backup_bucket.php:100
CBitrixCloudBackupBucket\unsetCheckWordHeader
unsetCheckWordHeader()
Определения
backup_bucket.php:95
CBitrixCloudBackupBucket\getFileName
getFileName()
Определения
backup_bucket.php:62
CCloudStorageBucket
Определения
storage_bucket.php:21
CCloudStorageBucket\getService
getService()
Определения
storage_bucket.php:127
CCloudStorageBucket\GetFileSRC
GetFileSRC($arFile, $encoded=true)
Определения
storage_bucket.php:427
$service
$service
Определения
payment.php:18
$location
$location
Определения
options.php:2729
$access_key
$access_key
Определения
result.php:8
bitrix
modules
bitrixcloud
classes
general
backup_bucket.php
Создано системой
1.14.0