Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F456546
DiffusionGitResponse.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
920 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
$this
->
headers
;
}
public
function
getCacheHeaders
()
{
return
array
();
}
public
function
getHTTPResponseCode
()
{
return
$this
->
httpCode
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 8:27 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70436
Default Alt Text
DiffusionGitResponse.php (920 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment