You are here

public static function S3Client::getBucketLocation in AmazonS3 7.2

Get the region for an S3Client for a specific bucket.

Parameters

string $bucket: The bucket to get the region for.

\Aws\S3\S3Client $client: The S3Client to use.

Return value

string The region for the bucket.

1 call to S3Client::getBucketLocation()
S3ClientTest::testGetBucketLocation in tests/S3ClientTest.php
@covers \Drupal\amazons3\S3Client::getBucketLocation

File

src/S3Client.php, line 159
A wrapper around S3Client::factory() using aws_key / aws_secret variables.

Class

S3Client
A wrapper around S3Client::factory() using aws_key / aws_secret variables.

Namespace

Drupal\amazons3

Code

public static function getBucketLocation($bucket, AwsS3Client $client) {
  return $client
    ->getBucketLocation(array(
    'Bucket' => $bucket,
  ))
    ->get('Location');
}