Created
November 20, 2012 03:35
-
-
Save pirasakat/4115785 to your computer and use it in GitHub Desktop.
PHP script to list bucket names on Amazon S3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/php | |
| /* | |
| Script to list buckets for Amazon S3 | |
| Usage | |
| $ ./aws_s3_list_buckets.php bucket_name | |
| */ | |
| <?php | |
| error_reporting(E_ALL); | |
| require_once('sdk.class.php'); | |
| $s3 = new AmazonS3(); | |
| $buckets = $s3->get_bucket_list(); | |
| foreach ($buckets as $bucket) | |
| { | |
| print($bucket . "¥n"); | |
| } | |
| exit(0); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment