Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894554
AphrontPHPHTTPSink.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
960 B
Referenced Files
None
Subscribers
None
AphrontPHPHTTPSink.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment