1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Scabbia2 LightStack Component |
4
|
|
|
* https://github.com/eserozvataf/scabbia2 |
5
|
|
|
* |
6
|
|
|
* For the full copyright and license information, please view the LICENSE |
7
|
|
|
* file that was distributed with this source code. |
8
|
|
|
* |
9
|
|
|
* @link https://github.com/eserozvataf/scabbia2-lightstack for the canonical source repository |
10
|
|
|
* @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
11
|
|
|
* @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Scabbia\LightStack; |
15
|
|
|
|
16
|
|
|
use Scabbia\LightStack\ResponseInterface; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Response implementation |
20
|
|
|
* |
21
|
|
|
* @package Scabbia\LightStack |
22
|
|
|
* @author Eser Ozvataf <[email protected]> |
23
|
|
|
* @since 2.0.0 |
24
|
|
|
*/ |
25
|
|
|
class Response implements ResponseInterface |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* Initializes a response |
29
|
|
|
* |
30
|
|
|
* @param string|null $uContent method |
31
|
|
|
* @param int|null $uStatus http status |
32
|
|
|
* @param array|null $uHeaders headers information will be sent |
33
|
|
|
* |
34
|
|
|
* @return Response response object |
|
|
|
|
35
|
|
|
*/ |
36
|
|
|
public function __construct($uContent = null, $uStatus = null, array $uHeaders = null) |
|
|
|
|
37
|
|
|
{ |
38
|
|
|
// TODO not implemented |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Sets weather request is handled or not |
43
|
|
|
* |
44
|
|
|
* @param bool $uHandled the status if request is handled |
45
|
|
|
* |
46
|
|
|
* @return void |
47
|
|
|
*/ |
48
|
|
|
public function setHandled($uHandled) |
49
|
|
|
{ |
50
|
|
|
// TODO not implemented |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Gets weather request is handled or not |
55
|
|
|
* |
56
|
|
|
* @return bool is handled |
57
|
|
|
*/ |
58
|
|
|
public function getHandled() |
59
|
|
|
{ |
60
|
|
|
// TODO not implemented |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Sets the status code and description |
65
|
|
|
* |
66
|
|
|
* @param int $uStatusCode the status or exit code |
67
|
|
|
* @param string $uDescription description for the status |
68
|
|
|
* |
69
|
|
|
* @return void |
70
|
|
|
*/ |
71
|
|
|
public function setStatus($uStatusCode, $uDescription) |
72
|
|
|
{ |
73
|
|
|
// TODO not implemented |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Sets session id |
78
|
|
|
* |
79
|
|
|
* @param string $uId session id to be set |
80
|
|
|
* |
81
|
|
|
* @return void |
82
|
|
|
*/ |
83
|
|
|
public function setSessionId($uId) |
84
|
|
|
{ |
85
|
|
|
// TODO not implemented |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Sets a session variable to be sent |
90
|
|
|
* |
91
|
|
|
* @param string $uKey key for the session variable |
92
|
|
|
* @param string $uValue value for the session variable |
93
|
|
|
* |
94
|
|
|
* @return void |
95
|
|
|
*/ |
96
|
|
|
public function setSession($uKey, $uValue) |
97
|
|
|
{ |
98
|
|
|
// TODO not implemented |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Sends a directive to remove session variable |
103
|
|
|
* |
104
|
|
|
* @param string $uKey key for the session variable |
105
|
|
|
* |
106
|
|
|
* @return void |
107
|
|
|
*/ |
108
|
|
|
public function removeSession($uKey) |
109
|
|
|
{ |
110
|
|
|
// TODO not implemented |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Gets a session variable to be sent |
115
|
|
|
* |
116
|
|
|
* @param string $uKey key for the session variable |
117
|
|
|
* |
118
|
|
|
* @return string value |
119
|
|
|
*/ |
120
|
|
|
public function getSession($uKey) |
121
|
|
|
{ |
122
|
|
|
// TODO not implemented |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Sends a directive to destroy all session data |
127
|
|
|
* |
128
|
|
|
* @return void |
129
|
|
|
*/ |
130
|
|
|
public function closeSession() |
131
|
|
|
{ |
132
|
|
|
// TODO not implemented |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Sets a cookie variable to be sent |
137
|
|
|
* |
138
|
|
|
* @param string $uKey key for the cookie variable |
139
|
|
|
* @param string $uValue value for the cookie variable |
140
|
|
|
* @param int $uTtl time to live (in seconds) |
141
|
|
|
* |
142
|
|
|
* @return void |
143
|
|
|
*/ |
144
|
|
|
public function setCookie($uKey, $uValue, $uTtl = 0) |
145
|
|
|
{ |
146
|
|
|
// TODO not implemented |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Sends a directive to remove cookie variable |
151
|
|
|
* |
152
|
|
|
* @param string $uKey key for the cookie variable |
153
|
|
|
* |
154
|
|
|
* @return void |
155
|
|
|
*/ |
156
|
|
|
public function removeCookie($uKey) |
157
|
|
|
{ |
158
|
|
|
// TODO not implemented |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* Gets a cookie variable to be sent |
163
|
|
|
* |
164
|
|
|
* @param string $uKey key for the cookie variable |
165
|
|
|
* |
166
|
|
|
* @return string value |
167
|
|
|
*/ |
168
|
|
|
public function getCookie($uKey) |
169
|
|
|
{ |
170
|
|
|
// TODO not implemented |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* Sets a header to be sent |
175
|
|
|
* |
176
|
|
|
* @param string $uKey key for the header |
177
|
|
|
* @param string $uValue value for the header |
178
|
|
|
* @param bool $uReplace replace existing headers with the same name |
179
|
|
|
* |
180
|
|
|
* @return void |
181
|
|
|
*/ |
182
|
|
|
public function setHeader($uKey, $uValue, $uReplace = false) |
183
|
|
|
{ |
184
|
|
|
// TODO not implemented |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* Removes a header to be sent |
189
|
|
|
* |
190
|
|
|
* @param string $uKey key for the header |
191
|
|
|
* |
192
|
|
|
* @return void |
193
|
|
|
*/ |
194
|
|
|
public function removeHeader($uKey) |
195
|
|
|
{ |
196
|
|
|
// TODO not implemented |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Gets a header to be sent |
201
|
|
|
* |
202
|
|
|
* @param string $uKey key for the header |
203
|
|
|
* |
204
|
|
|
* @return string value |
205
|
|
|
*/ |
206
|
|
|
public function getHeader($uKey) |
207
|
|
|
{ |
208
|
|
|
// TODO not implemented |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* Sets the content |
213
|
|
|
* |
214
|
|
|
* @param string $uContent response context |
215
|
|
|
* |
216
|
|
|
* @return void |
217
|
|
|
*/ |
218
|
|
|
public function setContent($uContent) |
219
|
|
|
{ |
220
|
|
|
// TODO not implemented |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* Gets the content to be sent |
225
|
|
|
* |
226
|
|
|
* @return string content |
227
|
|
|
*/ |
228
|
|
|
public function getContent() |
229
|
|
|
{ |
230
|
|
|
// TODO not implemented |
231
|
|
|
} |
232
|
|
|
} |
233
|
|
|
|
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.