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 | * Append one response object onto the end of another |
||
63 | * |
||
64 | * You cannot append a given response onto the end of a response of different type. |
||
65 | * If no prior response has been appended, this response becomes the main response |
||
66 | * object to which other response objects will be appended. |
||
67 | * |
||
68 | * @param Response $xResponse The response object to be appended |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function append(Response $xResponse) |
||
90 | |||
91 | /** |
||
92 | * Appends a debug message on the end of the debug message queue |
||
93 | * |
||
94 | * Debug messages will be sent to the client with the normal response |
||
95 | * (if the response object supports the sending of debug messages, see: <Response>) |
||
96 | * |
||
97 | * @param string $sMessage The debug message |
||
98 | * |
||
99 | * @return void |
||
100 | */ |
||
101 | public function debug($sMessage) |
||
105 | |||
106 | /** |
||
107 | * Prints the debug messages into the current response object |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function printDebug() |
||
122 | |||
123 | /** |
||
124 | * Sends the HTTP headers back to the browser |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public function sendHeaders() |
||
135 | |||
136 | /** |
||
137 | * Get the JSON output of the response |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getOutput() |
||
149 | |||
150 | /** |
||
151 | * Prints the response object to the output stream, thus sending the response to the browser |
||
152 | * |
||
153 | * @return void |
||
154 | */ |
||
155 | public function sendOutput() |
||
163 | } |
||
164 |