aws/aws-sdk-php — pull request #100 by jeremeamia (2013-06-05 01:29:05+00:00)
Title: Adding "facades" or the ability to use clients in a simple, static way

Facades are an optional feature. To enable facades, you need to instantiate `Aws\Common\Aws` class and use the `enableFacades` method.

```php
require './vendor/autoload.php';

Aws\Common\Aws::factory('./config.php')->enableFacades();
```

Then you can use the facades anywhere.

```php
echo "Current Buckets:\n";
foreach (S3::getIterator('ListBuckets') as $bucket) {
echo "{$bucket['Name']}\n";
}

$newBucket = 'new-bucket-name';
S3::createBucket(array('Bucket' => $newBucket));
S3::waitUntilBucketExists(array('Bucket' => $newBucket));
echo "\nCreated a new bucket: {$newBucket}.\n";

$result = S3::putObject(array(
'Bucket' => $newBucket,
'Key' => basename(__FILE__),
'Body' => fopen(__FILE__, 'r'),
));
echo "\nCreated a new object: {$result['ObjectURL']}\n";
```

---

Also in this PR is a change to make iterators easier to use.
```php
$s3->getIterator('ListObjects', array('Bucket' => 'new-bucket-name'));
```
Can now additionally be done like this:
```php
$s3->getListObjectsIterator(array('Bucket' => 'new-bucket-name'));
```