diff --git a/app/Services/Cloudflare/Account.php b/app/Services/Cloudflare/Account.php index 38f9447..c80202a 100644 --- a/app/Services/Cloudflare/Account.php +++ b/app/Services/Cloudflare/Account.php @@ -66,7 +66,7 @@ class Account extends Cloudflare foreach ($results_array as $results) { foreach ($results as $result) { if (!is_object($result) || get_class($result) !== 'stdClass') { - throw new \Exception("Account: result is array:\n" . var_export($result, true) . "\n"); + throw new \Exception("Account: result is not a stdClass:\n" . var_export($result, true) . "\n"); } $formDatas = $this->getArrayByResult($result); $entitys[$formDatas[AccountModel::PK]] = $this->getModel()->modify(new AccountEntity(), $formDatas); diff --git a/app/Services/Cloudflare/Cloudflare.php b/app/Services/Cloudflare/Cloudflare.php index 1606913..d223604 100644 --- a/app/Services/Cloudflare/Cloudflare.php +++ b/app/Services/Cloudflare/Cloudflare.php @@ -70,7 +70,11 @@ abstract class Cloudflare usleep(100000); // 0.1초 대기 $response = $this->reload_page($uri, $i, $per_page); $body = json_decode($response->getBody()); - $results = array_merge($results, $body->result); + if (!is_object($body->result) || get_class($body->result) !== 'stdClass') { + log_message("error", "body->result is not a stdClass:\n" . var_export($body->result, true) . "\n"); + } else { + $results = array_merge($results, $body->result); + } log_message("notice", "현재: page[{$i}/{$total_page}] , result수[" . count($results) . "]"); } return $results; diff --git a/app/Services/Cloudflare/Record.php b/app/Services/Cloudflare/Record.php index d1d058e..49e363e 100644 --- a/app/Services/Cloudflare/Record.php +++ b/app/Services/Cloudflare/Record.php @@ -148,7 +148,7 @@ class Record extends Cloudflare foreach ($results_array as $results) { foreach ($results as $result) { if (!is_object($result) || get_class($result) !== 'stdClass') { - throw new \Exception("Record: result is array:\n" . var_export($result, true) . "\n"); + throw new \Exception("Record: result is not a stdClass:\n" . var_export($result, true) . "\n"); } $formDatas = $this->getArrayByResult($result); $entitys[$formDatas[RecordModel::PK]] = $this->getModel()->modify(new RecordEntity(), $formDatas); diff --git a/app/Services/Cloudflare/Zone.php b/app/Services/Cloudflare/Zone.php index 788aaa2..cd24a90 100644 --- a/app/Services/Cloudflare/Zone.php +++ b/app/Services/Cloudflare/Zone.php @@ -154,7 +154,7 @@ class Zone extends Cloudflare foreach ($results_array as $results) { foreach ($results as $result) { if (!is_object($result) || get_class($result) !== 'stdClass') { - throw new \Exception("Zone: result is array:\n" . var_export($result, true) . "\n"); + throw new \Exception("Zone: result is not a stdClass:\n" . var_export($result, true) . "\n"); } $formDatas = $this->getArrayByResult($result); $formDatas = $this->getCFSetting($formDatas[ZoneModel::PK], $formDatas);