stage1/docker-php — pull request #51 by jeffturcotte (2014-08-17 16:59:57+00:00)
Title: ChunkedStream fix and findAll enhancement

When adding the ability to supply query params to ContainerManager::findAll, turns out that when the number of containers being returned exceeds a certain content length (or at least when the *all* flag is used) the remote API returns a chunked stream. This is a problematic as the data returned is one big JSON blob that cannot be parsed properly until you have all of it and the chunks have been joined.

The fix to ChunkedStream allows it to work as a normal Guzzle Stream in these scenarios. (i.e. $response->json or $response->getContents() will just work as expected). I think it's safe to assume that there will be other times where the docker daemon will return a single data blob as chunks.

The findAll enhancement allows for all the extra functionality of the /containers/json service. I can break it out if you want, but included it here because it validates the bug and vice versa.