Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98568371
AphrontIsolatedHTTPSink.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jan 14, 10:32
Size
703 B
Mime Type
text/x-php
Expires
Thu, Jan 16, 10:32 (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
23605475
Attached To
rPH Phabricator
AphrontIsolatedHTTPSink.php
View Options
<?php
/**
* Isolated HTTP sink for testing.
*/
final
class
AphrontIsolatedHTTPSink
extends
AphrontHTTPSink
{
private
$status
;
private
$headers
;
private
$data
;
protected
function
emitHTTPStatus
(
$code
,
$message
=
''
)
{
$this
->
status
=
$code
;
}
protected
function
emitHeader
(
$name
,
$value
)
{
$this
->
headers
[]
=
array
(
$name
,
$value
);
}
protected
function
emitData
(
$data
)
{
$this
->
data
.=
$data
;
}
protected
function
isWritable
()
{
return
true
;
}
public
function
getEmittedHTTPStatus
()
{
return
$this
->
status
;
}
public
function
getEmittedHeaders
()
{
return
$this
->
headers
;
}
public
function
getEmittedData
()
{
return
$this
->
data
;
}
}
Event Timeline
Log In to Comment