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:
parent
904fee3bed
commit
2dec8895a9
20 changed files with 466 additions and 382 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue