From 697ece6089e3424ea591e9c6f43a624fc3abbdbf Mon Sep 17 00:00:00 2001 From: Dmitri Vereshchagin Date: Mon, 1 Feb 2016 01:48:14 +0300 Subject: [PATCH 1/4] Add PSR-4 autoloading It's reasonable to put such a common name as `GetResponse` into namespace. --- README.md | 4 ++-- composer.json | 6 ++++-- src/{GetResponseAPI3.class.php => GetResponse.php} | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) rename src/{GetResponseAPI3.class.php => GetResponse.php} (99%) diff --git a/README.md b/README.md index fb0edaf..bca4245 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ GetResponse API v3 wrapper working on PHP 5.2+. Standard authorization ```php -$getresponse = new GetResponse('your_api_key'); +$getresponse = new GetResponse\GetResponse('your_api_key'); ``` -- Enterprise authorization ```php -$getresponse = new GetResponse('your_api_key'); +$getresponse = new GetResponse\GetResponse('your_api_key'); $getresponse->enterprise_domain = 'somedomain.com'; //api URL is relative to your domain UR: diff --git a/composer.json b/composer.json index 3bd66e2..bb325e2 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,8 @@ "ext-curl": "*" }, "autoload": { - "files": ["src/GetResponseAPI3.class.php"] + "psr-4": { + "GetResponse\\": "src/" + } } -} \ No newline at end of file +} diff --git a/src/GetResponseAPI3.class.php b/src/GetResponse.php similarity index 99% rename from src/GetResponseAPI3.class.php rename to src/GetResponse.php index 2782e2f..06bfedc 100644 --- a/src/GetResponseAPI3.class.php +++ b/src/GetResponse.php @@ -1,5 +1,7 @@ Date: Mon, 1 Feb 2016 02:00:36 +0300 Subject: [PATCH 2/4] Remove `version` property from composer.json Composer recognizes version from repository tag names. It's recommended by official documentation to omit this property. --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index bb325e2..c0767ef 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,6 @@ { "name": "getresponse/getresponse", "description": "GetResponse API v3 client library.", - "version": "0.0.2", "homepage": "https://github.com/GetResponse/getresponse-api-php", "keywords": ["GetResponse", "api", "email"], "type": "library", From 9f0f675a0bdd66523b26e9e7ae71697945af3b64 Mon Sep 17 00:00:00 2001 From: Dmitri Vereshchagin Date: Mon, 1 Feb 2016 02:10:24 +0300 Subject: [PATCH 3/4] Remove `type` property from composer.json If there's no need for custom installation logic Composer documentation recommends to omit this field. --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index c0767ef..fe58c5a 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "GetResponse API v3 client library.", "homepage": "https://github.com/GetResponse/getresponse-api-php", "keywords": ["GetResponse", "api", "email"], - "type": "library", "license": "MIT", "authors": [ { From 455ae6f47edf8c93ca91b4ef17ab8f176c3a80b4 Mon Sep 17 00:00:00 2001 From: Dmitri Vereshchagin Date: Tue, 2 Feb 2016 09:31:53 +0300 Subject: [PATCH 4/4] Increase required PHP version to 5.3 Support for namespaces introduced in PHP 5.3.0. --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bca4245..b677a72 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Overview -GetResponse API v3 wrapper working on PHP 5.2+. +GetResponse API v3 wrapper working on PHP 5.3+. [Here](http://apidocs.getresponse.com/en/v3/) you can find our api documentation. ##Examples diff --git a/composer.json b/composer.json index fe58c5a..715f52c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=5.2.0", + "php": ">=5.3.0", "ext-curl": "*" }, "autoload": {