1
0
Fork 0

Curl Response Refactoring

- extended Curl to parse Curl Response
- refactored Network::curl()
- replaced every Network::curl() execution with the new Curl container
This commit is contained in:
Philipp Holzer 2018-10-10 21:08:43 +02:00
commit 2dec8895a9
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
20 changed files with 466 additions and 382 deletions

View file

@ -179,17 +179,17 @@ class ExAuth
$url = ($ssl ? 'https' : 'http') . '://' . $host . '/noscrape/' . $user;
$data = Network::curl($url);
$curlResult = Network::curl($url);
if (!is_array($data)) {
if (!$curlResult->isSuccess()) {
return false;
}
if ($data['return_code'] != '200') {
if ($curlResult->getReturnCode() != 200) {
return false;
}
$json = @json_decode($data['body']);
$json = @json_decode($curlResult->getBody());
if (!is_object($json)) {
return false;
}