#!/usr/bin/php
<?php
/*
 * list_buckets.php
 *
 * List S3 buckets.
 *
 * Copyright 2009-2010 Amazon.com, Inc. or its affiliates. All Rights
 * Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"). You
 * may not use this file except in compliance with the License. A copy
 * of the License is located at
 *
 *       http://aws.amazon.com/apache2.0/
 *
 * or in the "license.txt" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
 * OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the
 * License.
 */

error_reporting(E_ALL);

require_once('cloudfusion.class.php');

// Create the S3 access object
$s3 = new AmazonS3();

// Retrieve list of S3 buckets
$buckets = $s3->get_bucket_list();

// Display list of buckets
foreach ($buckets as $bucket)
{
  print($bucket . "\n");
}

exit(0);
?>

#!/usr/bin/php
<?php
/*
 * list_buckets.php
 *
 * List S3 buckets.
 *
 * Copyright 2009-2010 Amazon.com, Inc. or its affiliates. All Rights
 * Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"). You
 * may not use this file except in compliance with the License. A copy
 * of the License is located at
 *
 *       http://aws.amazon.com/apache2.0/
 *
 * or in the "license.txt" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
 * OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the
 * License.
 *
 * Modified by Jeffrey S. Haemer <jeffrey.haemer@gmail.com>
 */

error_reporting(E_ALL);

require_once('AWSSDKforPHP/sdk.class.php');

// Create the S3 access object
$s3 = new AmazonS3();

// Retrieve list of S3 buckets
$buckets = $s3->get_bucket_list();

// Display list of buckets
foreach ($buckets as $bucket)
{
  print($bucket . "\n");
}

exit(0);
?>

Modify to use right toolkit.
Modify to use right toolkit.

First blood!
