Skip to content

Commit

Permalink
Merge pull request Corsinvest#12 from Nexus633/patch-1
Browse files Browse the repository at this point in the history
Update PveClientBase.php
  • Loading branch information
franklupo authored Feb 15, 2021
2 parents 6c082b2 + 524c178 commit b1335b1
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/PveClientBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ private function executeAction($resource, $method, $parameters = []) {
});

if ($this->getDebugLevel() >= 1) {
echo "Method: " . method . " , Url: " . $url . "\n";
if (method != 'GET') {
echo "Method: " . $method . " , Url: " . $url . "\n";
if ($method != 'GET') {
echo "Parameters:\n";
var_dump($params);
}
Expand Down Expand Up @@ -350,12 +350,18 @@ private function executeAction($resource, $method, $parameters = []) {
$parameters,
$methodType,
$this->responseType);

if ($this->getDebugLevel() >= 2) {
echo $obj . "\n";
echo "StatusCode: " . $lastResult->getStatusCode() . "\n";
echo "ReasonPhrase: " . $lastResult->getReasonPhrase() . "\n";
echo "IsSuccessStatusCode: " . $lastResult->isSuccessStatusCode() . "\n";
if(is_array($obj)){
echo '<pre>';
print_r($obj);
echo '</pre>';
}else{
echo $obj . PHP_EOL;
}
echo "StatusCode: " . $lastResult->getStatusCode() . PHP_EOL;
echo "ReasonPhrase: " . $lastResult->getReasonPhrase() . PHP_EOL;
echo "IsSuccessStatusCode: " . $lastResult->isSuccessStatusCode() . PHP_EOL;
}

if ($this->getDebugLevel() > 0) {
Expand Down Expand Up @@ -408,7 +414,7 @@ public function waitForTaskToFinish($node, $task, $wait = 500, $timeOut = 10000)
* @return bool
*/
function waitForTaskToFinish1($task, $wait = 500, $timeOut = 10000) {
return waitForTaskToFinish(split(':', $task)[1], $task, $wait, $timeOut);
return waitForTaskToFinish(preg_split(':', $task)[1], $task, $wait, $timeOut);
}

/**
Expand Down

0 comments on commit b1335b1

Please sign in to comment.