本文整理匯總了PHP中Aws\S3\S3Client::getBucketLocation方法的典型用法代碼示例。如果您正苦於以下問題:PHP S3Client::getBucketLocation方法的具體用法?PHP S3Client::getBucketLocation怎麽用?PHP S3Client::getBucketLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Aws\S3\S3Client
的用法示例。
在下文中一共展示了S3Client::getBucketLocation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testPutBucketLocation
/**
* @depends testHeadBucket
*/
public function testPutBucketLocation()
{
$this->log(__METHOD__);
$bucketName = self::getResourcePrefix() . '-s3eutest';
try {
$this->client->headBucket(array('Bucket' => $bucketName));
} catch (\Exception $e) {
$this->client->createBucket(array('Bucket' => $bucketName, 'LocationConstraint' => 'EU'));
}
$this->client->waitUntil('bucket_exists', array('Bucket' => $bucketName));
$result = $this->client->getBucketLocation(array('Bucket' => $bucketName));
$this->assertEquals('EU', $result['Location']);
$this->client->deleteBucket(array('Bucket' => $bucketName));
}
示例2: getBucketLocation
/**
* Returns the region the bucket resides in.
*
* @param string $bucket
*
* @return mixed
*/
public function getBucketLocation($bucket)
{
$params = ['Bucket' => $bucket];
return $this->instance->getBucketLocation($params);
}