Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101508254
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, Feb 11, 03:26
Size
703 B
Mime Type
text/x-php
Expires
Thu, Feb 13, 03:26 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
24180361
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