Gets the region in which the specified Amazon S3 bucket is located.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the bucket to use. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Get the region code that the bucket is contained in.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east' . strtolower($s3->key); $response = $s3->get_bucket_region($bucket); // Success? var_dump($response->isOK()); var_dump($response->body === ''); // U.S. Standard Region is an empty string.Result:
bool(true) bool(true)
Related Methods
Source
Method defined in services/s3.class.php | Toggle source view (18 lines) | View on GitHub