rackspace/php-opencloud — pull request #481 by ycombinator (2014-12-02 21:01:49+00:00)
Title: Reliably delete a container with its objects

This PR is a (hopefully) final attempt at providing a method to reliably delete a container along with its constituent objects. The crux of the algorithm implemented by this PR is:

1. Get a list of objects.
2. Attempt to delete them using the batch delete API.
3. Attempt to delete the container using the container delete API.
4. If step 3 succeeds, we are done!
5. If step 3 results in a `404 Not Found` error (indicating that the container is not found), we are done!
6. If step 3 results in a `409 Conflict` error (indicating that the container is not actually empty), start over with step 1.