Skip to content

Commit

Permalink
Merge branch 'release/v1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
themodernpk committed Feb 7, 2022
2 parents 6be6a06 + c349c92 commit ca66c16
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
40 changes: 26 additions & 14 deletions CPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,35 +183,47 @@ public function call($module, $function, $args = array())

curl_close($curl);

$curl_response_decoded = json_decode($curl_res);

$response['inputs']['url'] = $url;

$response['curl_response'] = [
'curl_response' => $curl_res,
'curl_response_decoded' => $curl_response_decoded,
'header_size' => $header_size,
'header' => $header,
'response' => $curl_res,
'body' => $body,
'error' => $err,
'err_no' => $err_no,
];



if ($err || $err_no) {

$response['status'] = 'failed';
$response['errors'] = $err;

} else {

if(isset($res) && isset($res->status) && $res->status == 0)
{
$response['status'] = 'failed';
$response['errors'][] = $res->errors;
$response['inputs']['url'] = $url;
} else
{
$response['data'] = json_decode($curl_res);
$response['status'] = 'success';
$response['inputs']['url'] = $url;
}
} if(isset($curl_response_decoded->errors) && count($curl_response_decoded->errors) > 0)
{
$response['status'] = 'failed';
$response['errors'] = $curl_response_decoded->errors;

} else {

if(isset($res) && isset($res->status) && $res->status == 0)
{
$response['status'] = 'failed';
$response['errors'][] = $res->errors;
$response['inputs']['url'] = $url;
} else
{
$response['data'] = json_decode($curl_res);
$response['status'] = 'success';
$response['inputs']['url'] = $url;
}
}


return $response;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["laravel", "cpanel", "cpanel api", "cpanel uapi"],
"homepage": "https://www.webreinvent.com",
"license": "MIT",
"version": "1.3.2",
"version": "1.3.3",
"authors": [
{
"name": "WebReinvent",
Expand Down

0 comments on commit ca66c16

Please sign in to comment.