From 64a1081c7db9bd2b6af9c07f39ca5e99e4d6efcb Mon Sep 17 00:00:00 2001 From: Dmytro Klyman Date: Tue, 5 Mar 2019 22:44:15 +0100 Subject: [PATCH] Better Readme --- .travis.yml | 8 ++++++++ README.md | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f2ac70a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: php +php: + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' diff --git a/README.md b/README.md index d704e75..635969f 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,26 @@ +[![Total Downloads](https://poser.pugx.org/dmytroklyman/amazon-advertising-api-php-sdk/downloads)](https://packagist.org/packages/dmytroklyman/amazon-advertising-api-php-sdk) +[![Build Status](https://api.travis-ci.org/dmytroklyman/amazon-advertising-api-php-sdk.png?branch=master)](http://travis-ci.org/dmytroklyman/amazon-advertising-api-php-sdk) + ## Synopsis -Official Amazon Advertising API PHP client library. +Fork of official Amazon Advertising API PHP client library, that solves the problems of the official lib. + +In some cases Amazon Advertising API requires the usage of BigInt data type (ex. keyword ID, ad group ID etc.). As you know, PHP doesn't have BigInt data type. If you send such IDs as a string in request, you get an exception in response. + +This fork solves this problem and supports the JSON encoded parameters string in Client methods. + +To convert the strings into "BigInt" and generate the request parameters string, use the following regex: + +`preg_replace('/("\w+"):"(\d+)"/', '\\1:\\2', json_encode($params));` + +To convert the BigInt into string in response string, use the JSON_BIGINT_AS_STRING parameter in json_decode: + +`json_decode($response['response'], true, 512, JSON_BIGINT_AS_STRING);` + ## Requirements -PHP >= 5.3.0
+PHP >= 5.4.0
cURL >= 7.18 ## Documentation