From 143a1d2bd25b261d1f4cb971d56a3555102d78aa Mon Sep 17 00:00:00 2001 From: VinayBhalerao Date: Tue, 21 Feb 2017 15:12:15 -0800 Subject: [PATCH 1/3] added php version to track it in 3scale saas backend --- lib/ThreeScaleClient.php | 6 ++++++ lib/version.php | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lib/version.php diff --git a/lib/ThreeScaleClient.php b/lib/ThreeScaleClient.php index 5b291a1..bdc5a55 100644 --- a/lib/ThreeScaleClient.php +++ b/lib/ThreeScaleClient.php @@ -10,6 +10,7 @@ require_once(dirname(__FILE__) . '/ThreeScaleResponse.php'); require_once(dirname(__FILE__) . '/ThreeScaleAuthorizeResponse.php'); +require_once(dirname(__FILE__) . '/version.php'); /** @@ -557,7 +558,12 @@ private static function isHttpStatusCodeIn($httpResponse, $min, $max) { public function setHttpClient($httpClient) { if (is_null($httpClient)) { $httpClient = new Curl; + $threeScaleVersion = new ThreeScaleVersion(); + + $version = $threeScaleVersion->getVersion(); + $httpClient->options['CURLOPT_FOLLOWLOCATION'] = false; + $httpClient->headers['X-3scale-User-Agent'] = 'plugin-php-v'. $version; } $this->httpClient = $httpClient; diff --git a/lib/version.php b/lib/version.php new file mode 100644 index 0000000..ba17736 --- /dev/null +++ b/lib/version.php @@ -0,0 +1,15 @@ +version; + } +} + +?> From e302dfe74663d291ed6876a72ec33ae2fa8c03cf Mon Sep 17 00:00:00 2001 From: VinayBhalerao Date: Tue, 21 Feb 2017 15:18:32 -0800 Subject: [PATCH 2/3] [changelog] added client header --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700ad34..bc551a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,11 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Added +- Added client header ```X-3scale-User-Agent: plugin-php-v{version-number} + ### Changed -- Allow custom host and port configurable for 3scale On premise SAAS platform [PR #16](https://github.com/3scale/3scale_ws_api_for_php/.) Note: For example, the signature is changed from ```$url = "http://" . $this->getHost() . "/transactions/authorize.xml"``` to ```$url = $this->getHost() . "/transactions/oauth_authorize.xml";``` for endpoints +- Allow custom host and port configurable for 3scale On premise SAAS platform [PR #16](https://github.com/3scale/3scale_ws_api_for_php/pull/16) Note: For example, the signature is changed from ```$url = "http://" . $this->getHost() . "/transactions/authorize.xml"``` to ```$url = $this->getHost() . "/transactions/oauth_authorize.xml";``` for endpoints ##[2.7.0] - 2017-02-16 ### Added From 4287c92cf9625b07064dfb932123c2c405ad2c10 Mon Sep 17 00:00:00 2001 From: VinayBhalerao Date: Tue, 21 Feb 2017 15:25:54 -0800 Subject: [PATCH 3/3] bump version --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc551a0..e9cdb6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. -## Unreleased +## 2.7.1 ### Added -- Added client header ```X-3scale-User-Agent: plugin-php-v{version-number} +- Added client header ```X-3scale-User-Agent: plugin-php-v{version-number} [PR #17](https://github.com/3scale/3scale_ws_api_for_php/pull/17) ### Changed - Allow custom host and port configurable for 3scale On premise SAAS platform [PR #16](https://github.com/3scale/3scale_ws_api_for_php/pull/16) Note: For example, the signature is changed from ```$url = "http://" . $this->getHost() . "/transactions/authorize.xml"``` to ```$url = $this->getHost() . "/transactions/oauth_authorize.xml";``` for endpoints