Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 4c8358d

Browse files
author
Jens Schulze
committed
Merge branch 'release/v1.5.0'
2 parents 78eab58 + 7c5e503 commit 4c8358d

File tree

256 files changed

+2883
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+2883
-333
lines changed

CHANGELOG.md

Lines changed: 279 additions & 242 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# <img src="build/theme/resources/CT_cube_200px.png" width="40" align="center"></img> commercetools PHP SDK
22

3-
[![Build Status](https://img.shields.io/travis/sphereio/commercetools-php-sdk/master.svg?style=flat-square)](https://travis-ci.org/sphereio/commercetools-php-sdk) [![Scrutinizer](https://img.shields.io/scrutinizer/g/sphereio/commercetools-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/sphereio/commercetools-php-sdk/) [![Scrutinizer](https://img.shields.io/scrutinizer/coverage/g/sphereio/commercetools-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/sphereio/commercetools-php-sdk/) [![Packagist](https://img.shields.io/packagist/v/commercetools/php-sdk.svg?style=flat-square)](https://packagist.org/packages/commercetools/php-sdk) [![Packagist](https://img.shields.io/packagist/dm/commercetools/php-sdk.svg?style=flat-square)](https://packagist.org/packages/commercetools/php-sdk)
3+
[![Build Status](https://img.shields.io/travis/commercetools/commercetools-php-sdk/master.svg?style=flat-square)](https://travis-ci.org/commercetools/commercetools-php-sdk) [![Scrutinizer](https://img.shields.io/scrutinizer/g/commercetools/commercetools-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/commercetools/commercetools-php-sdk/) [![Scrutinizer](https://img.shields.io/scrutinizer/coverage/g/commercetools/commercetools-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/commercetools/commercetools-php-sdk/) [![Packagist](https://img.shields.io/packagist/v/commercetools/php-sdk.svg?style=flat-square)](https://packagist.org/packages/commercetools/php-sdk) [![Packagist](https://img.shields.io/packagist/dm/commercetools/php-sdk.svg?style=flat-square)](https://packagist.org/packages/commercetools/php-sdk)
44

5-
The PHP SDK allows developers to build applications on the commercetools platform (technically speaking against the SPHERE.IO REST API) using PHP native interfaces, models and helpers instead of manually using the HTTP and JSON API.
5+
The PHP SDK allows developers to build applications on the commercetools platform (technically speaking against our REST API) using PHP native interfaces, models and helpers instead of manually using the HTTP and JSON API.
66

77
You gain lots of IDE Auto-Completion, type checks on a literal API, Warnings, Object Mapping, i18n support etc.. The Client manages the OAuth2 security tokens, provides caches and interfaces for concurrent and asynchronous API calls.
88

@@ -11,11 +11,11 @@ The SDK is licensed under the permissive [MIT License](LICENSE). Don't hesitate
1111

1212
## Using the SDK
1313

14-
The [PHP API documentation](http://sphereio.github.io/commercetools-php-sdk/docs/master) provides all the details you need in a searchable form (link points to latest stable release).
14+
The [PHP API documentation](http://commercetools.github.io/commercetools-php-sdk/docs/master) provides all the details you need in a searchable form (link points to latest stable release).
1515

1616
### Install & Integrate the SDK into your Project
1717

18-
The SDK requires a PHP version of 5.4 or higher. The SDK tries to use the APC(u) as it's default cache. If you provide an own cache interface or a [PSR-6](https://packagist.org/providers/psr/cache-implementation) compliant cache adapter, APC(u) is not necessary. The [cache/filesystem-adapter](https://packagist.org/packages/cache/filesystem-adapter) is tried to be used if no APC(u) is installed. See also client [documentation](http://sphereio.github.io/commercetools-php-sdk/docs/master/class-Commercetools.Core.Client.html).
18+
The SDK requires a PHP version of 5.4 or higher. The SDK tries to use the APC(u) as it's default cache. If you provide an own cache interface or a [PSR-6](https://packagist.org/providers/psr/cache-implementation) compliant cache adapter, APC(u) is not necessary. The [cache/filesystem-adapter](https://packagist.org/packages/cache/filesystem-adapter) is tried to be used if no APC(u) is installed. See also client [documentation](http://commercetools.github.io/commercetools-php-sdk/docs/master/class-Commercetools.Core.Client.html).
1919

2020
The curl extension is recommended but not strictly necessary because the SDK is using the [Guzzle library](https://github.com/guzzle/guzzle) library, which falls back to PHP stream wrappers if curl is not available.
2121
The intl extension is required to directly output Money objects as a String.
@@ -52,7 +52,7 @@ After installing, you need to require Composer's autoloader if that's not yet th
5252
require 'vendor/autoload.php';
5353
```
5454

55-
If you don't use Composer, just [download a zip archive](https://github.com/sphereio/commercetools-php-sdk/archive/master.zip) of the latest release, manually integrate it and configure your own autoloader.
55+
If you don't use Composer, just [download a zip archive](https://github.com/commercetools/commercetools-php-sdk/archive/master.zip) of the latest release, manually integrate it and configure your own autoloader.
5656

5757
Until the 1.0.0 release M0, M1 etc. milestone releases can contain incompatible changes. From 1.0.0 on, the project will follow the [semantic versioning](http://semver.org) guidelines, i.e. everything but major version changes are backwards-compatible. This matches composer's default behavior.
5858

@@ -141,7 +141,7 @@ php composer.phar update
141141
Clone the develop branch of the repository (we're using the [gitflow](http://nvie.com/posts/a-successful-git-branching-model/) branching model, so master is for releases only):
142142

143143
```
144-
git clone [email protected]:sphereio/commercetools-php-sdk.git
144+
git clone [email protected]:commercetools/commercetools-php-sdk.git
145145
```
146146

147147
Please follow the [PSR-2](http://www.php-fig.org/psr/psr-2/) coding style, ideally via your IDE settings (see below for PhpStorm instructions).

build/apigen.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
title: PHP SDK
2-
baseUrl: http://sphereio.github.io/commercetools-php-sdk/docs/master
2+
baseUrl: http://commercetools.github.io/commercetools-php-sdk/docs/master
33

44
source: [src/]
55
destination: build/docs

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"license": "MIT",
44
"type": "project",
55
"description": "The commercetools PHP SDK \n The official PHP Interface to the commercetools eCommerce API",
6-
"homepage": "https://github.com/sphereio/commercetools-php-sdk",
6+
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
77
"support": {
88
"email": "[email protected]",
99
"forum": "http://support.sphere.io",
10-
"issues": "https://github.com/sphereio/commercetools-php-sdk/issues",
11-
"docs": "http://sphereio.github.io/commercetools-php-sdk/docs/master/"
10+
"issues": "https://github.com/commercetools/commercetools-php-sdk/issues",
11+
"docs": "http://commercetools.github.io/commercetools-php-sdk/docs/master/"
1212
},
1313
"autoload": {
1414
"psr-4": {
@@ -61,7 +61,7 @@
6161
},
6262
"extra": {
6363
"branch-alias": {
64-
"dev-develop": "1.4-dev"
64+
"dev-develop": "1.5-dev"
6565
},
6666
"incenteev-parameters": [
6767
{

docroot/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Commercetools\Core\Request\Products\ProductProjectionSearchRequest;
1717
use Symfony\Component\Yaml\Yaml;
1818

19-
require __DIR__ . '../vendor/autoload.php';
19+
require __DIR__ . '/../vendor/autoload.php';
2020

2121
$appConfig = Yaml::parse(file_get_contents('myapp.yml'));
2222
$context = Context::of()->setLanguages(['en'])->setGraceful(true);

push-docs-to-gh-pages.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
export SDK_VERSION=$TRAVIS_BRANCH;
1212
if [ $(phpenv version-name) = "5.6" ] ; then ant apigen; fi
1313

14-
if [ "$TRAVIS_REPO_SLUG" == "sphereio/commercetools-php-sdk" ] && [ $(phpenv version-name) = "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ( [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == `git describe --tags --always HEAD` ] ); then
14+
if [ "$TRAVIS_REPO_SLUG" == "commercetools/commercetools-php-sdk" ] && [ $(phpenv version-name) = "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ( [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == `git describe --tags --always HEAD` ] ); then
1515
echo -e "Publishing documentation to gh-pages branch ...\n"
1616

1717
cp -R build/docs $HOME/phpdoc-current
@@ -20,7 +20,7 @@ if [ "$TRAVIS_REPO_SLUG" == "sphereio/commercetools-php-sdk" ] && [ $(phpenv ver
2020
cd $HOME
2121
git config --global user.email "[email protected]"
2222
git config --global user.name "travis CI"
23-
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/sphereio/commercetools-php-sdk gh-pages > /dev/null 2>&1
23+
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/commercetools/commercetools-php-sdk gh-pages > /dev/null 2>&1
2424

2525
cd gh-pages
2626
git rm -rf ./docs/$TRAVIS_BRANCH

src/AbstractHttpClient.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '1.4.0';
17+
const VERSION = '1.5.0';
1818

1919
/**
2020
* @var AdapterInterface
@@ -110,10 +110,14 @@ abstract protected function getBaseUrl();
110110
protected function getUserAgent()
111111
{
112112
if (is_null($this->userAgent)) {
113-
$agent = 'commercetools-php-sdk/' . static::VERSION . ' PHP/' . PHP_VERSION;
113+
$agent = 'commercetools-php-sdk/' . static::VERSION;
114+
115+
$adapterClass = $this->getAdapterFactory()->getClass($this->getConfig()->getAdapter());
116+
$agent .= ' (' . $adapterClass::getAdapterInfo();
114117
if (extension_loaded('curl') && function_exists('curl_version')) {
115-
$agent .= ' curl/' . \curl_version()['version'];
118+
$agent .= '; curl/' . \curl_version()['version'];
116119
}
120+
$agent .= ') PHP/' . PHP_VERSION;
117121
$this->userAgent = $agent;
118122
}
119123

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* ```php
5151
* $request = ProductProjectionSearchRequest::of();
5252
* $response = $request->executeWithClient($client);
53-
* $products = $request->mapResponse($response);
53+
* $products = $request->mapFromResponse($response);
5454
* ```
5555
*
5656
* By using the request centric approach the IDE is capable of resolving the correct classes and give

src/Client/Adapter/AdapterInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ public function authenticate($oauthUri, $clientId, $clientSecret, $formParams);
4242
* @return AdapterPromiseInterface
4343
*/
4444
public function executeAsync(RequestInterface $request);
45+
46+
/**
47+
* returns used HTTP Client and version
48+
* @return string
49+
*/
50+
public static function getAdapterInfo();
4551
}

src/Client/Adapter/Guzzle5Adapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,9 @@ function (\GuzzleHttp\Message\ResponseInterface $response) {
236236

237237
return $promise;
238238
}
239+
240+
public static function getAdapterInfo()
241+
{
242+
return 'GuzzleHttp/' . Client::VERSION;
243+
}
239244
}

0 commit comments

Comments
 (0)