Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
955 B · 44 lines
PHP
123456789101112131415161718192021222324252627282930313233343536373839404142434445<?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; }
}