UnionOfRAD/lithium — pull request #1110 by davidpersson (2014-08-07 11:19:19+00:00)
Title: Changing stream handling in action request; BC Break.

Will not drain stream and assign data when binary data was send. This reduces memory
usage and enables streaming very large files (i.e. uploading video content).

- `$request->data` may now be either received (form) data or an open
stream handle if binary data was send.

- Automatic content decoding for streamed data is not supported anymore.

This feature may return at a later point in a different implementation which may use
stream wrappers to decode on-the-fly. Disabling corresponding tests.

How this breaks BC: When streaming JSON or XML data, the data is not decoded
automatically anymore. `$request->data` will therefore not hold an array of data
anymore, but an open resource handle. You will need to read from the stream and decode
manually:

```
$data = Media::decode( // new
$request->type,
stream_get_contents($request->data)
);
```

- Removing `stream` property and reusing data for holding stream.

Semantically there is no difference between data in a stream and data in complex
data structure i.e. an array.

How this breaks BC: When initializing a request object manually a stream should
now be passed under the `data` configuration option.

```
$stream = fopen('php://temp', 'r');

new Request(array('stream' => $stream)); // old
new Request(array('data' => $stream)); // new
```

- Still autocloses opened stream.

- Refactoring `_init` to use autoConfig for data.

- Expanding documentation.

- Defaulting `data` property to `null`.