Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F19081869
DiffusionGitResponse.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
955 B
Referenced Files
None
Subscribers
None
DiffusionGitResponse.php
View Options
<?php
final
class
DiffusionGitResponse
extends
AphrontResponse
{
private
$httpCode
;
private
$headers
=
array
();
private
$response
;
public
function
setGitData
(
$data
)
{
list
(
$headers
,
$body
)
=
explode
(
"
\r\n\r\n
"
,
$data
,
2
);
$this
->
response
=
$body
;
$headers
=
explode
(
"
\r\n
"
,
$headers
);
$matches
=
null
;
$this
->
httpCode
=
200
;
$this
->
headers
=
array
();
foreach
(
$headers
as
$header
)
{
if
(
preg_match
(
'/^Status:
\s
*(
\d
+)/i'
,
$header
,
$matches
))
{
$this
->
httpCode
=
(
int
)
$matches
[
1
];
}
else
{
$this
->
headers
[]
=
explode
(
': '
,
$header
,
2
);
}
}
return
$this
;
}
public
function
buildResponseString
()
{
return
$this
->
response
;
}
public
function
getHeaders
()
{
return
array_merge
(
parent
::
getHeaders
(),
$this
->
headers
);
}
public
function
getCacheHeaders
()
{
return
array
();
}
public
function
getHTTPResponseCode
()
{
return
$this
->
httpCode
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 4, 8:38 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8226142
Default Alt Text
DiffusionGitResponse.php (955 B)
Attached To
Mode
rP Phabricator
Attached
Detach File
Event Timeline
Log In to Comment