Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F427061
AphrontJSONResponse.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
865 B
Referenced Files
None
Subscribers
None
AphrontJSONResponse.php
View Options
<?php
final
class
AphrontJSONResponse
extends
AphrontResponse
{
private
$content
;
private
$addJSONShield
;
public
function
setContent
(
$content
)
{
$this
->
content
=
$content
;
return
$this
;
}
public
function
setAddJSONShield
(
$should_add
)
{
$this
->
addJSONShield
=
$should_add
;
return
$this
;
}
public
function
shouldAddJSONShield
()
{
if
(
$this
->
addJSONShield
===
null
)
{
return
true
;
}
return
(
bool
)
$this
->
addJSONShield
;
}
public
function
buildResponseString
()
{
$response
=
$this
->
encodeJSONForHTTPResponse
(
$this
->
content
);
if
(
$this
->
shouldAddJSONShield
())
{
$response
=
$this
->
addJSONShield
(
$response
);
}
return
$response
;
}
public
function
getHeaders
()
{
$headers
=
parent
::
getHeaders
();
$headers
[]
=
array
(
'Content-Type'
,
'application/json'
);
return
$headers
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 3:52 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
58500
Default Alt Text
AphrontJSONResponse.php (865 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment