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
parent 904fee3bed
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

@ -82,10 +82,10 @@ class Magic extends BaseModule
);
// Try to get an authentication token from the other instance.
$x = Network::curl($basepath . '/owa', false, $redirects, ['headers' => $headers]);
$curlResult = Network::curl($basepath . '/owa', false, $redirects, ['headers' => $headers]);
if ($x['success']) {
$j = json_decode($x['body'], true);
if ($curlResult->isSuccess()) {
$j = json_decode($curlResult->getBody(), true);
if ($j['success']) {
$token = '';