Gets whether or not the specified Amazon S3 bucket exists in Amazon S3. This includes buckets that do not belong to the caller.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the bucket to use. |
Returns
Type |
Description |
---|---|
A value of |
Examples
Check if a bucket exists in the S3 system.
Note: A successful response does NOT mean that you own the bucket.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->if_bucket_exists($bucket); // Success? (Boolean, not a CFResponse object) var_dump($response);Result:
bool(true)
Related Methods
Source
Method defined in services/s3.class.php | Toggle source view (10 lines) | View on GitHub