Provide missing default attachment list for Files transactions
[phabricator.git] / src / aphront / sink / AphrontPHPHTTPSink.php
blob4953b6e61037ba3568a929951fff764adb236fea
1 <?php
3 /**
4 * Concrete HTTP sink which uses "echo" and "header()" to emit data.
5 */
6 final class AphrontPHPHTTPSink extends AphrontHTTPSink {
8 protected function emitHTTPStatus($code, $message = '') {
9 if ($code != 200) {
10 $header = "HTTP/1.0 {$code}";
11 if (strlen($message)) {
12 $header .= " {$message}";
14 header($header);
18 protected function emitHeader($name, $value) {
19 header("{$name}: {$value}", $replace = false);
22 protected function emitData($data) {
23 echo $data;
25 // NOTE: We don't call flush() here because it breaks HTTPS under Apache.
26 // See T7620 for discussion. Even without an explicit flush, PHP appears to
27 // have reasonable behavior here: the echo will block if internal buffers
28 // are full, and data will be sent to the client once enough of it has
29 // been buffered.
32 protected function isWritable() {
33 return !connection_aborted();