Page MenuHomePhorge

AphrontPHPHTTPSink.php
No OneTemporary

AphrontPHPHTTPSink.php

<?php
/**
* Concrete HTTP sink which uses "echo" and "header()" to emit data.
*/
final class AphrontPHPHTTPSink extends AphrontHTTPSink {
protected function emitHTTPStatus($code, $message = '') {
if ($code != 200) {
$header = "HTTP/1.0 {$code}";
if (phutil_nonempty_string($message)) {
$header .= " {$message}";
}
header($header);
}
}
protected function emitHeader($name, $value) {
header("{$name}: {$value}", $replace = false);
}
protected function emitData($data) {
echo $data;
// NOTE: We don't call flush() here because it breaks HTTPS under Apache.
// See T7620 for discussion. Even without an explicit flush, PHP appears to
// have reasonable behavior here: the echo will block if internal buffers
// are full, and data will be sent to the client once enough of it has
// been buffered.
}
protected function isWritable() {
return !connection_aborted();
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 20:03 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128265
Default Alt Text
AphrontPHPHTTPSink.php (960 B)

Event Timeline