Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/sink/AphrontHTTPSink.php
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | /* -( Writing Response Components )---------------------------------------- */ | ||||
| /** | /** | ||||
| * Write an entire @{class:AphrontResponse} to the output. | * Write an entire @{class:AphrontResponse} to the output. | ||||
| * | * | ||||
| * @param AphrontResponse The response object to write. | * @param AphrontResponse The response object to write. | ||||
| * @return void | * @return void | ||||
| */ | */ | ||||
| final public function writeResponse(AphrontResponse $response) { | final public function writeResponse(AphrontResponse $response) { | ||||
| $response->willBeginWrite(); | |||||
| // Build the content iterator first, in case it throws. Ideally, we'd | // Build the content iterator first, in case it throws. Ideally, we'd | ||||
| // prefer to handle exceptions before we emit the response status or any | // prefer to handle exceptions before we emit the response status or any | ||||
| // HTTP headers. | // HTTP headers. | ||||
| $data = $response->getContentIterator(); | $data = $response->getContentIterator(); | ||||
| $all_headers = array_merge( | $all_headers = array_merge( | ||||
| $response->getHeaders(), | $response->getHeaders(), | ||||
| $response->getCacheHeaders()); | $response->getCacheHeaders()); | ||||
| Show All 28 Lines | |||||