1 | <?php |
||
24 | class Manager |
||
25 | { |
||
26 | use \Jaxon\Utils\Traits\Translator; |
||
27 | |||
28 | /** |
||
29 | * The current response object that will be sent back to the browser |
||
30 | * once the request processing phase is complete |
||
31 | * |
||
32 | * @var \Jaxon\Response\Response |
||
33 | */ |
||
34 | private $xResponse; |
||
35 | |||
36 | /** |
||
37 | * The debug messages |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | private $aDebugMessages; |
||
42 | |||
43 | public function __construct() |
||
48 | |||
49 | /** |
||
50 | * Clear the current response |
||
51 | * |
||
52 | * A new response will need to be appended before the request processing is complete. |
||
53 | * |
||
54 | * @return void |
||
55 | */ |
||
56 | public function clear() |
||
60 | |||
61 | /** |
||
62 | * Check if there is currently no response |
||
63 | * |
||
64 | * @return boolean |
||
65 | */ |
||
66 | public function hasNoResponse() |
||
70 | |||
71 | /** |
||
72 | * Append one response object onto the end of another |
||
73 | * |
||
74 | * You cannot append a given response onto the end of a response of different type. |
||
75 | * If no prior response has been appended, this response becomes the main response |
||
76 | * object to which other response objects will be appended. |
||
77 | * |
||
78 | * @param Response $xResponse The response object to be appended |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | public function append(Response $xResponse) |
||
100 | |||
101 | /** |
||
102 | * Appends a debug message on the end of the debug message queue |
||
103 | * |
||
104 | * Debug messages will be sent to the client with the normal response |
||
105 | * (if the response object supports the sending of debug messages, see: <Response>) |
||
106 | * |
||
107 | * @param string $sMessage The debug message |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function debug($sMessage) |
||
115 | |||
116 | /** |
||
117 | * Prints the debug messages into the current response object |
||
118 | * |
||
119 | * @return void |
||
120 | */ |
||
121 | public function printDebug() |
||
132 | |||
133 | /** |
||
134 | * Sends the HTTP headers back to the browser |
||
135 | * |
||
136 | * @return void |
||
137 | */ |
||
138 | public function sendHeaders() |
||
145 | |||
146 | /** |
||
147 | * Get the JSON output of the response |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getOutput() |
||
159 | |||
160 | /** |
||
161 | * Prints the response object to the output stream, thus sending the response to the browser |
||
162 | * |
||
163 | * @return void |
||
164 | */ |
||
165 | public function sendOutput() |
||
173 | } |
||
174 |