-
Notifications
You must be signed in to change notification settings - Fork 64
/
Backblaze.php
53 lines (47 loc) · 1.3 KB
/
Backblaze.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Utopia\Storage\Device;
use Utopia\Storage\Device\S3;
class Backblaze extends S3
{
/**
* Regions constants
*
*/
const US_WEST_001 = 'us-west-001';
const US_WEST_002 = 'us-west-002';
const US_WEST_003 = 'us-west-003';
const US_WEST_004 = 'us-west-004';
const EU_CENTRAL_001 = 'eu-central-001';
const EU_CENTRAL_002 = 'eu-central-002';
const EU_CENTRAL_003 = 'eu-central-003';
const EU_CENTRAL_004 = 'eu-central-004';
/**
* Backblaze Constructor
*
* @param string $root
* @param string $accessKey
* @param string $secretKey
* @param string $bucket
* @param string $region
* @param string $acl
*/
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::US_WEST_004, string $acl = self::ACL_PRIVATE)
{
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl);
$this->headers['host'] = $bucket . '.' . 's3' . '.' . $region . '.backblazeb2.com';
}
/**
* @return string
*/
public function getName(): string
{
return 'Backblaze B2 Storage';
}
/**
* @return string
*/
public function getDescription(): string
{
return 'Backblaze B2 Storage';
}
}