-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathS3.php
102 lines (99 loc) · 2.56 KB
/
S3.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
namespace Thai\S3\Helper;
/**
* Provides list of regions.
*/
class S3
{
/**
* Determines whether an S3 region code is valid.
*
* @param string $regionInQuestion
* @return bool
*/
public function isValidRegion($regionInQuestion)
{
foreach ($this->getRegions() as $currentRegion) {
if ($currentRegion['value'] == $regionInQuestion) {
return true;
}
}
return false;
}
/**
* @return array
*/
public function getRegions()
{
return [
[
'value' => 'ap-northeast-1',
'label' => 'Asia Pacific (Tokyo)',
],
[
'value' => 'ap-northeast-2',
'label' => 'Asia Pacific (Seoul)',
],
[
'value' => 'ap-south-1',
'label' => 'Asia Pacific (Mumbai)',
],
[
'value' => 'ap-southeast-1',
'label' => 'Asia Pacific (Singapore)',
],
[
'value' => 'ap-southeast-2',
'label' => 'Asia Pacific (Sydney)',
],
[
'value' => 'ca-central-1',
'label' => 'Canada (Central)',
],
[
'value' => 'cn-north-1',
'label' => 'China (Beijing)',
],
[
'value' => 'cn-northwest-1',
'label' => 'China (Ningxia)',
],
[
'value' => 'eu-central-1',
'label' => 'EU (Frankfurt)',
],
[
'value' => 'eu-west-1',
'label' => 'EU (Ireland)',
],
[
'value' => 'eu-west-2',
'label' => 'EU (London)',
],
[
'value' => 'eu-west-3',
'label' => 'EU (Paris)',
],
[
'value' => 'sa-east-1',
'label' => 'South America (Sao Paulo)',
],
[
'value' => 'us-east-1',
'label' => 'US East (N. Virginia)',
],
[
'value' => 'us-east-2',
'label' => 'US East (Ohio)',
],
[
'value' => 'us-west-1',
'label' => 'US West (N. California)',
],
[
'value' => 'us-west-2',
'label' => 'US West (Oregon)',
],
];
}
}