From 4446946faef893c0d84567d8130432437b1320bb Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:48:01 +0100 Subject: [PATCH 01/10] Update README.md --- README.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a689f2a607..518e47af5f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](http://devbay.net/sdk/guides/getting-started/installation.html) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). -This is a personal project that has been developed by me, [David T. Sadler](http://twitter.com/davidtsadler). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. +This is a personal project that has been developed by me, [David T. Sadler](https://davidtsadler.com). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. ## Features @@ -14,11 +14,9 @@ This is a personal project that has been developed by me, [David T. Sadler](http ## Resources - - [User Guides](http://devbay.net/sdk/guides/) - Getting started guide and in-depth information. + - [User Guides](https://github.com/davidtsadler/ebay-sdk-php/wiki) - Getting started guide and in-depth information. - [Examples](https://github.com/davidtsadler/ebay-sdk-examples) - Several examples of using the SDK. - - [Google Group](https://groups.google.com/forum/#!forum/ebay-sdk-php) - Join for support with the SDK. - - [@devbaydotnet](https://twitter.com/devbaydotnet) - Follow on Twitter for announcements of releases, important changes and so on. - + ## Requirements - PHP 5.5 or greater with the following extensions: @@ -74,13 +72,6 @@ $response = $service->geteBayTime($request); printf("The official eBay time is: %s\n", $response->Timestamp->format('H:i (\G\M\T) \o\n l jS Y')); ``` -## Project Goals - - - Be well maintained. - - Be [well documented](http://devbay.net/sdk/guides/). - - Be [well tested](https://github.com/davidtsadler/ebay-sdk-php/tree/master/test). - - Be well supported with [working examples](https://github.com/davidtsadler/ebay-sdk-examples). - ## License Licensed under the [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). From 620a0812e3a7b64596fc83b16f7f9d5300583a89 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:48:50 +0100 Subject: [PATCH 02/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 518e47af5f..51ef8f5746 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **This repository is no longer actively maintained and has been archived.** -This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](http://devbay.net/sdk/guides/getting-started/installation.html) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). +This project enables PHP developers to use the [eBay API](https://go.developer.ebay.com/api-documentation) in their PHP code, and build software using services such as [Finding](http://developer.ebay.com/Devzone/finding/Concepts/FindingAPIGuide.html), [Trading](http://developer.ebay.com/DevZone/guides/ebayfeatures/index.html), [Shopping](http://developer.ebay.com/Devzone/shopping/docs/Concepts/ShoppingAPIGuide.html), etc. You can get started by [installing the SDK via Composer](https://github.com/davidtsadler/ebay-sdk-php/wiki/Installation) and by following the [Basic Usage Guide](http://devbay.net/sdk/guides/getting-started/basic-usage.html). This is a personal project that has been developed by me, [David T. Sadler](https://davidtsadler.com). I decided to create this project to make up for the lack of an official SDK for PHP. It is in no way endorsed, sponsored or maintained by eBay. From 744dc96f3a82b14a494ed5f8b05708c87bc297ea Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 12 Jun 2021 22:49:38 +0100 Subject: [PATCH 03/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51ef8f5746..3bf57949a2 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This is a personal project that has been developed by me, [David T. Sadler](http ## Installation -The SDK can be installed with [Composer](http://getcomposer.org/). Please see the [Installation section of the User Guide](http://devbay.net/sdk/guides/getting-started/installation.html) to learn about installing through other means. +The SDK can be installed with [Composer](http://getcomposer.org/). Please see the [Installation section of the User Guide](https://github.com/davidtsadler/ebay-sdk-php/wiki/Installation) to learn about installing through other means. 1. Install Composer. From 478e40512d6500f9c8ca4489eb65ea0643d2df05 Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Fri, 14 Jul 2023 11:31:08 -0400 Subject: [PATCH 04/10] Update composer.json Temporary change to personal repo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 94406936eb..1e4d349165 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "benmorel/ebay-sdk-php", + "name": "xtremevision/ebay-sdk-php", "description": "An eBay SDK for PHP. Fork of dts/ebay-sdk-php with support for PHP 8.", "keywords": ["ebay", "api", "sdk"], "type": "library", From c713626f2e73a87705715a8ff5dd2cdebe9a94b9 Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Wed, 29 Nov 2023 15:28:45 -0500 Subject: [PATCH 05/10] Updated support for guzzlehttp/psr7 > 2.0 in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1e4d349165..17fa79b4a2 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-curl": "*", "ext-libxml": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", "guzzlehttp/promises": "^1.1" }, "require-dev": { From c52daea849baccb4fb24e386163f5ba8cced8855 Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Fri, 14 Jul 2023 11:31:08 -0400 Subject: [PATCH 06/10] Update composer.json Temporary change to personal repo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 94406936eb..1e4d349165 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "benmorel/ebay-sdk-php", + "name": "xtremevision/ebay-sdk-php", "description": "An eBay SDK for PHP. Fork of dts/ebay-sdk-php with support for PHP 8.", "keywords": ["ebay", "api", "sdk"], "type": "library", From 9b54cd6d178b8890eb7f9797047e0bacbb8a7adc Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Wed, 29 Nov 2023 15:28:45 -0500 Subject: [PATCH 07/10] Updated support for guzzlehttp/psr7 > 2.0 in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1e4d349165..17fa79b4a2 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-curl": "*", "ext-libxml": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", "guzzlehttp/promises": "^1.1" }, "require-dev": { From e8f29b64dd44077e213bb37dd94bb4450f846f31 Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Tue, 8 Oct 2024 12:12:11 -0400 Subject: [PATCH 08/10] added http response headers to response --- src/Services/BaseService.php | 1 + src/Types/BaseType.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Services/BaseService.php b/src/Services/BaseService.php index 05046b5ad2..695dc2ba80 100644 --- a/src/Services/BaseService.php +++ b/src/Services/BaseService.php @@ -176,6 +176,7 @@ function (ResponseInterface $res) use ($debug, $responseClass) { $response = $xmlParser->parse($xmlResponse); $response->attachment($attachment); + $response->responseHeaders($res->getHeaders()); return $response; } diff --git a/src/Types/BaseType.php b/src/Types/BaseType.php index 26269fdf58..25a2407c84 100644 --- a/src/Types/BaseType.php +++ b/src/Types/BaseType.php @@ -50,6 +50,11 @@ class BaseType implements JmesPathableObjectInterface */ private $attachment; + /** + * @var string Associative array storing the httpHandler responseHeaders. + */ + private $responseheaders; + /** * @param array $values Can pass an associative array that will set the objects properties. */ @@ -62,6 +67,7 @@ public function __construct(array $values = []) $this->setValues(__CLASS__, $values); $this->attachment = ['data' => null, 'mimeType' => null]; + $this->responseheaders = ['data' => null]; } /** @@ -207,6 +213,27 @@ public function hasAttachment() return $this->attachment['data'] !== null; } + /** + * Method to get or set the object's response headers. Overrides any existing response headers. + * + * @param mixed $data If a string it is assumed to be the contents of the attachment. If an array copy its values across. + * + * @return mixed Returns the contents of the current atachment or null if none has been specified. + */ + public function responseheaders($data = null) + { + if ($data !== null) { + $this->responseheaders['data'] = json_encode($data); + } + + return $this->responseheaders; + } + + public function getResponseHeaders() + { + return json_decode($this->responseheaders['data']); + } + /** * Helper method that returns an associative array of the object's properties and values. * @@ -289,6 +316,8 @@ protected function setValues($class, array $values = []) */ private function get($class, $name) { + echo $class, ": ", $name, "\n"; + self::ensurePropertyExists($class, $name); return $this->getValue($class, $name); From ea9f0640692ffc006712738f5057e892b32aea9f Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Tue, 8 Oct 2024 12:43:00 -0400 Subject: [PATCH 09/10] Removed a debug echo statement --- src/Types/BaseType.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Types/BaseType.php b/src/Types/BaseType.php index 25a2407c84..938aada260 100644 --- a/src/Types/BaseType.php +++ b/src/Types/BaseType.php @@ -316,8 +316,6 @@ protected function setValues($class, array $values = []) */ private function get($class, $name) { - echo $class, ": ", $name, "\n"; - self::ensurePropertyExists($class, $name); return $this->getValue($class, $name); From aeec64029890efd2fd519525940090471e46378d Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Tue, 8 Oct 2024 13:00:26 -0400 Subject: [PATCH 10/10] fixed return type --- src/Types/BaseType.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Types/BaseType.php b/src/Types/BaseType.php index 938aada260..d1b5a06eb8 100644 --- a/src/Types/BaseType.php +++ b/src/Types/BaseType.php @@ -51,7 +51,7 @@ class BaseType implements JmesPathableObjectInterface private $attachment; /** - * @var string Associative array storing the httpHandler responseHeaders. + * @var array Associative array storing the httpHandler responseHeaders. */ private $responseheaders; @@ -216,11 +216,11 @@ public function hasAttachment() /** * Method to get or set the object's response headers. Overrides any existing response headers. * - * @param mixed $data If a string it is assumed to be the contents of the attachment. If an array copy its values across. + * @param mixed $data If a string it is assumed to be the contents of the response headers. If an array copy its values across. * - * @return mixed Returns the contents of the current atachment or null if none has been specified. + * @return mixed Returns the contents of the current response headers or null if none has been specified. */ - public function responseheaders($data = null) + public function responseheaders($data = null) : mixed { if ($data !== null) { $this->responseheaders['data'] = json_encode($data);