Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93046597
DiffusionGitResponse.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
Mon, Nov 25, 19:26
Size
920 B
Mime Type
text/x-php
Expires
Wed, Nov 27, 19:26 (2 d)
Engine
blob
Format
Raw Data
Handle
22562450
Attached To
rPH Phabricator
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
$this
->
headers
;
}
public
function
getCacheHeaders
()
{
return
array
();
}
public
function
getHTTPResponseCode
()
{
return
$this
->
httpCode
;
}
}
Event Timeline
Log In to Comment