From f2d51b017e329601093ff24cfb66d3abffae82f2 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Tue, 26 Jul 2016 14:57:13 +0300 Subject: [PATCH 1/3] improve retry --- lib/RetailCrm/Http/Client.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/RetailCrm/Http/Client.php b/lib/RetailCrm/Http/Client.php index 6a446c8..58b628a 100644 --- a/lib/RetailCrm/Http/Client.php +++ b/lib/RetailCrm/Http/Client.php @@ -55,14 +55,6 @@ class Client $this->url = $url; $this->defaultParameters = $defaultParameters; - $this->retry = 0; - $this->curlErrors = array( - CURLE_COULDNT_RESOLVE_PROXY, - CURLE_COULDNT_RESOLVE_HOST, - CURLE_COULDNT_CONNECT, - CURLE_OPERATION_TIMEOUTED, - CURLE_SSL_CONNECT_ERROR - ); } /** @@ -86,7 +78,6 @@ class Client array $parameters = array() ) { $allowedMethods = array(self::METHOD_GET, self::METHOD_POST); - $retry = 0; if (!in_array($method, $allowedMethods, false)) { throw new \InvalidArgumentException( @@ -128,18 +119,7 @@ class Client curl_close($curlHandler); - if ($errno - && in_array($errno, $this->curlErrors, false) - && $retry < 3 - ) { - $errno = null; - $error = null; - $retry++; - $this->makeRequest($path, $method, $parameters); - } - if ($errno) { - $retry = 0; throw new CurlException($error, $errno); } From c0c7ac6a7ee54d2e83420aa379b749378ec47a81 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 28 Jul 2016 10:47:24 +0300 Subject: [PATCH 2/3] store settings api url fix --- lib/RetailCrm/ApiClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RetailCrm/ApiClient.php b/lib/RetailCrm/ApiClient.php index 2c1defe..e8795a0 100644 --- a/lib/RetailCrm/ApiClient.php +++ b/lib/RetailCrm/ApiClient.php @@ -777,7 +777,7 @@ class ApiClient } return $this->client->makeRequest( - "/store/settings/$code", + "/store/setting/$code", Client::METHOD_GET ); } @@ -802,7 +802,7 @@ class ApiClient } return $this->client->makeRequest( - sprintf('/store/settings/%s/edit', $configuration['code']), + sprintf('/store/setting/%s/edit', $configuration['code']), Client::METHOD_POST, $configuration ); From 1f662a020aea5b62a55e65042e4aabd3ab39b680 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 10 Aug 2016 00:35:46 +0300 Subject: [PATCH 3/3] fix apigen config --- apigen.neon | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/apigen.neon b/apigen.neon index 965b4d0..463b181 100644 --- a/apigen.neon +++ b/apigen.neon @@ -1,32 +1,27 @@ extensions: - php - + source: - lib - + exclude: - tests/ - vendor/ - bin/ - docs/ - + charset: - auto - UTF-8 - Windows-1251 - + title: retailCRM PHP API client templateTheme: bootstrap groups: auto -autocomplete: - - classes - - constants - - methods - - classconstants - + accessLevels: - public - + internal: true php: false tree: true