Gets a simplified list of bucket names on an Amazon S3 account.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Optional |
A Perl-Compatible Regular Expression (PCRE) to filter the bucket names against. |
Returns
Type |
Description |
---|---|
The list of matching bucket names. If there are no results, the method will return an empty array. |
Examples
Get the list of buckets in your account.
// Instantiate the class $s3 = new AmazonS3(); $response = $s3->get_bucket_list(); // Success? print_r($response);
Get the list of buckets in your account that match a PCRE regular expression pattern.
// Instantiate the class $s3 = new AmazonS3(); // Only return the buckets with 'my-' in the name $response = $s3->get_bucket_list('/my-/i'); // Success? print_r($response);
Related Methods
See Also
Source
Method defined in services/s3.class.php | Toggle source view (19 lines) | View on GitHub