| 1 | <?php |
||
| 10 | trait Data { |
||
| 11 | /** |
||
| 12 | * Data array, similar to `$_POST` |
||
| 13 | * |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | public $data; |
||
| 17 | /** |
||
| 18 | * Data stream resource, similar to `fopen('php://input', 'br')` |
||
| 19 | * |
||
| 20 | * Make sure you're controlling position in stream where you read something, if code in some other place might seek on this stream |
||
| 21 | * |
||
| 22 | * @var null|resource |
||
| 23 | */ |
||
| 24 | public $data_stream; |
||
| 25 | /** |
||
| 26 | * @param array $data Typically `$_POST` |
||
| 27 | * @param null|resource|string $data_stream String, like `php://input` or resource, like `fopen('php://input', 'br')` |
||
| 28 | */ |
||
| 29 | function init_data ($data = [], $data_stream = null) { |
||
| 36 | } |
||
| 37 |