Installation guide

'VaultExists' => array(
'extends' => '__VaultState',
'success.type' => 'output',
'description' => 'Wait until a vault can be accessed.',
'ignore_errors' => array(
'ResourceNotFoundException',
),
),
'VaultNotExists' => array(
'extends' => '__VaultState',
'description' => 'Wait until a vault is deleted.',
'success.type' => 'error',
'success.value' => 'ResourceNotFoundException',
),
),
// ...
);
In order for you to contribute waiters to the SDK, you will need to implement them using the waiters DSL. The DSL is
not documented yet, since it is currently subject to change, so if you are interested in helping to implement more
waiters, please reach out to us via GitHub.
Iterators
Introduction
Some AWS operations return truncated results that require subsequent requests in order to retrieve the entire result
set. The subsequent requests typically require pagination tokens or markers from the previous request in order to
retrieve the next set of results. Working with these tokens can be cumbersome, since you must manually keep track
of them, and the API for each service may differ in how it uses them.
The AWS SDK for PHP has a feature called iterators that allow you to retrieve an entire result set without manually
handling pagination tokens or markers. The iterators in the SDK implement PHP's Iterator interface, which
allows you to easily enumerate or iterate through resources from a result set with foreach.
You can find a list of the iterators supported by a client by viewing the docblock of a client. Any @method tag that
has a name that looks like "get[…]Iterator" will return an iterator. For example, the following code uses the
getListObjectsIterator() method of the S3 client object to create an iterator for objects in a bucket.
$iterator = $client->getListObjectsIterator(array('Bucket' => 'my-bucket'));
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
The "get[…]Iterator" methods are all implemented via the __call magic method, and are a more discoverable
shortcut to using the concrete getIterator() method, since many IDEs can auto-complete methods defined
using the @method annotation. The following code uses the getIterator() method, but is equivalent to the
previous code sample.
$iterator = $client->getIterator('ListObjects', array('Bucket' => 'my-bucket'));
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
The getIterator() method also accepts a command object for the first argument. If you have a command object
already instantiated, you can create an iterator directly from the command object.
$command = $client->getCommand('ListObjects', array('Bucket' => 'my-bucket'));
$iterator = $client->getIterator($command);
Iterators
35