Decompress fetched response data

This commit is contained in:
Steffen Lange 2021-06-01 12:26:32 +02:00
parent 311846b4c9
commit 3f65352c06

View file

@ -57,6 +57,15 @@ abstract class PatchBase {
} }
return false; return false;
} }
protected function fetch_gzip(string $url) : bool {
$str = $this->curl($url);
if ($str) {
if (!($this->data = gzdecode($str)))
return false;
return true;
}
return false;
}
protected function parse(string $re) : bool { protected function parse(string $re) : bool {
if ($str = $this->regex_str($re)) { if ($str = $this->regex_str($re)) {
$this->patch->setVersion($str, true); $this->patch->setVersion($str, true);