1 | <?php |
||
7 | class Request |
||
8 | { |
||
9 | /** |
||
10 | * Application Object |
||
11 | * |
||
12 | * @var \System\Application |
||
13 | */ |
||
14 | private $app; |
||
15 | |||
16 | /** |
||
17 | * Constructor |
||
18 | * |
||
19 | * @param \System\Application $app |
||
20 | */ |
||
21 | public function __construct(Application $app) |
||
25 | |||
26 | /** |
||
27 | * Get value from spcefic request type |
||
28 | * |
||
29 | * @param array $requestType |
||
30 | * @param string $key |
||
31 | * @return mixed |
||
32 | */ |
||
33 | private function getValueOfRequest($requestType, $key) |
||
44 | |||
45 | /** |
||
46 | * Get value from $_GET by the given key |
||
47 | * |
||
48 | * @param string $key |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function get(string $key = null) |
||
58 | |||
59 | /** |
||
60 | * Get value from $_POST by the given key |
||
61 | * |
||
62 | * @param string $key |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function post(string $key = null) |
||
72 | |||
73 | /** |
||
74 | * Get value from $_FILES by the given key |
||
75 | * |
||
76 | * @param string $key |
||
77 | * @return mixed |
||
78 | */ |
||
79 | public function file(string $key = null) |
||
86 | |||
87 | /** |
||
88 | * Get value from $_SERVER by the given key |
||
89 | * |
||
90 | * @param string $key |
||
91 | * @return string |
||
92 | */ |
||
93 | public function server(string $key) |
||
100 | |||
101 | /** |
||
102 | * Set value To $_POST For the given key |
||
103 | * |
||
104 | * @param string $key |
||
105 | * @param mixed $value |
||
106 | * @return void |
||
107 | */ |
||
108 | public function setPost(string $key, $value) |
||
112 | |||
113 | /** |
||
114 | * Set value To $_GET For the given key |
||
115 | * |
||
116 | * @param string $key |
||
117 | * @param mixed $value |
||
118 | * @return void |
||
119 | */ |
||
120 | public function setGet(string $key, $value) |
||
124 | |||
125 | /** |
||
126 | * Set value To $_FILES For the given key |
||
127 | * |
||
128 | * @param string $key |
||
129 | * @param mixed $value |
||
130 | * @return void |
||
131 | */ |
||
132 | public function setFile(string $key, $value) |
||
136 | |||
137 | /** |
||
138 | * Set value To $_SERVER For the given key |
||
139 | * |
||
140 | * @param string $key |
||
141 | * @param mixed $value |
||
142 | * @return void |
||
143 | */ |
||
144 | public function setServer(string $key, $value) |
||
148 | |||
149 | /** |
||
150 | * Get current request method |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function method() |
||
158 | |||
159 | /** |
||
160 | * Check if the request to the admin panel |
||
161 | * |
||
162 | * @return bool |
||
163 | */ |
||
164 | public function isRequestToAdminManagement() |
||
173 | |||
174 | /** |
||
175 | * Check the request method |
||
176 | * |
||
177 | * @param string|array $methods |
||
178 | * @return bool |
||
179 | */ |
||
180 | public function isMatchingRequestMethod($method) |
||
187 | |||
188 | /** |
||
189 | * Check if the request can be Continued |
||
190 | * |
||
191 | * @property object $load |
||
192 | * @param array $middlewares |
||
193 | * @return bool |
||
194 | */ |
||
195 | public function canRequestContinue(array $middlewares) |
||
208 | } |
||
209 |