From 37af9763bcb19e3b030ef4868e2edde15cb015ea Mon Sep 17 00:00:00 2001 From: Dmitry Fedyuk Date: Sun, 16 Jul 2017 15:11:25 +0300 Subject: [PATCH] 1.0.2 --- composer.json | 4 ++-- lib/main.php | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 00c145b..29445c4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/oro" - ,"version": "1.0.1" + ,"version": "1.0.2" ,"description": "A custom integration between Magento 2 and Oro Platform." ,"type": "magento2-module" ,"homepage": "https://ocrm.pro" @@ -11,6 +11,6 @@ "homepage": "https://mage2.pro/users/dmitry_fedyuk", "role": "Developer" }] - ,"require": {"mage2pro/core": ">=2.7.40"} + ,"require": {"mage2pro/core": ">=2.8.17"} ,"autoload": {"files": ["registration.php"], "psr-4": {"Df\\Oro\\": ""}} } \ No newline at end of file diff --git a/lib/main.php b/lib/main.php index 8eacdd4..8f4156a 100644 --- a/lib/main.php +++ b/lib/main.php @@ -29,8 +29,10 @@ function df_oro_get_list( $raw = null; $c = null; /** @var C $c */ while (!$raw && $attempt++ <= $maxAttempts) { - $c = (new C) - ->setConfig(['timeout' => 120]) + $c = df_zf_http('https://' + . ($local ? 'localhost.com:848/app_dev.php' : 'erp.mage2.pro') + . "/api/extenddf$entity" + ) // 2017-06-28 // Due to a Oro Platform bug, the «content-type» headers is required for the «vnd» case, // even it does not have any sense here. @@ -39,18 +41,8 @@ function df_oro_get_list( ->setHeaders(df_oro_headers() + (!$vnd ? ['accept' => 'application/json'] : array_fill_keys( ['accept', 'content-type'], 'application/vnd.api+json' ))) - ->setUri( - 'https://' - . ($local ? 'localhost.com:848/app_dev.php' : 'erp.mage2.pro') - . "/api/extenddf$entity" - ) ->setParameterGet(df_clean(['filter' => $filter, 'include' => df_csv($include)])) ; - if ($local) { - $c->setAdapter((new \Zend_Http_Client_Adapter_Socket)->setStreamContext([ - 'ssl' => ['allow_self_signed' => true, 'verify_peer' => false] - ])); - } $raw = $c->request()->getBody(); } if (!$raw) {