1 | <?php |
||
23 | class Request { |
||
24 | use |
||
25 | Singleton, |
||
26 | Cookie, |
||
27 | Data_and_files, |
||
28 | Query, |
||
29 | Route, |
||
30 | Server; |
||
31 | /** |
||
32 | * Global request id, used by system |
||
33 | * |
||
34 | * @var int |
||
35 | */ |
||
36 | public static $id = 0; |
||
37 | /** |
||
38 | * Unix timestamp when request processing started |
||
39 | * |
||
40 | * @var float |
||
41 | */ |
||
42 | public $started; |
||
43 | /** |
||
44 | * Initialize request object with specified data |
||
45 | * |
||
46 | * @param string[] $server Typically `$_SERVER` |
||
47 | * @param array $query Typically `$_GET` |
||
48 | * @param array $data Typically `$_POST` |
||
49 | * @param array[] $files Typically `$_FILES`; might be like native PHP array `$_FILES` or normalized; each file item MUST contain |
||
50 | * keys `name`, `type`, `size`, `error` and at least one of `tmp_name` or `stream` |
||
51 | * @param null|resource|string $data_stream String, like `php://input` or resource, like `fopen('php://input', 'rb')` |
||
52 | * @param string[] $cookie Typically `$_COOKIE` |
||
53 | * @param float $request_started Unix timestamp when request processing started |
||
54 | * |
||
55 | * @throws ExitException |
||
56 | */ |
||
57 | 24 | function init ($server, $query, $data, $files, $data_stream, $cookie, $request_started) { |
|
66 | /** |
||
67 | * Initialize request object from superglobals `$_SERVER`, `$_GET`, `$_POST`, `$_COOKIE` and `$_FILES` (including parsing `php://input` when necessary) |
||
68 | * |
||
69 | * @throws ExitException |
||
70 | */ |
||
71 | 24 | function init_from_globals () { |
|
74 | } |
||
75 |