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

Commit 1d2d635

Browse files
author
Jens Schulze
committed
Merge branch 'release/v1.1'
2 parents 9c37c74 + 961ccad commit 1d2d635

File tree

93 files changed

+2174
-74
lines changed

Some content is hidden

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

93 files changed

+2174
-74
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ myapp.ini
1414
/tools/node_modules
1515
requests.log
1616
env.list
17+
humbug.*
18+
/cache

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
<a name="1.1.0"></a>
2+
# [1.1.0](https://github.com/sphereio/commercetools-php-sdk/compare/v1.0.1...v1.1.0) (2016-05-27)
3+
4+
5+
### Bug Fixes
6+
7+
* **JsonObject:** fix JsonObject::hasField method to return if the field has a value set ([c2eaed5](https://github.com/sphereio/commercetools-php-sdk/commit/c2eaed5)), closes [#173](https://github.com/sphereio/commercetools-php-sdk/issues/173)
8+
9+
### Features
10+
11+
* **Cache:** add support for PSR-6 cache adapter ([e6cbd27](https://github.com/sphereio/commercetools-php-sdk/commit/e6cbd27)), closes [#194](https://github.com/sphereio/commercetools-php-sdk/issues/194)
12+
* **Cart:** support new cart tax modes ([f6bfeeb](https://github.com/sphereio/commercetools-php-sdk/commit/f6bfeeb)), closes [#207](https://github.com/sphereio/commercetools-php-sdk/issues/207)
13+
* **Customer:** support anonymous cart sign in mode for customer login ([e94ac48](https://github.com/sphereio/commercetools-php-sdk/commit/e94ac48)), closes [#212](https://github.com/sphereio/commercetools-php-sdk/issues/212)
14+
* **Error:** add DiscountCodeNonApplicable error ([a42e90d](https://github.com/sphereio/commercetools-php-sdk/commit/a42e90d)), closes [#198](https://github.com/sphereio/commercetools-php-sdk/issues/198)
15+
* **Product:** add changeMasterVariant update action ([48d1a42](https://github.com/sphereio/commercetools-php-sdk/commit/48d1a42)), closes [#204](https://github.com/sphereio/commercetools-php-sdk/issues/204)
16+
* **Product:** add getAllVariants helper method to product data ([006e984](https://github.com/sphereio/commercetools-php-sdk/commit/006e984)), closes [#213](https://github.com/sphereio/commercetools-php-sdk/issues/213)
17+
* **Product:** add image move to position update action ([c24839b](https://github.com/sphereio/commercetools-php-sdk/commit/c24839b)), closes [#206](https://github.com/sphereio/commercetools-php-sdk/issues/206)
18+
* **Product:** add scopedPrice and scopePriceDiscounted to ProductVariant model ([f7d25d8](https://github.com/sphereio/commercetools-php-sdk/commit/f7d25d8)), closes [#201](https://github.com/sphereio/commercetools-php-sdk/issues/201)
19+
* **Product:** add support to publish product on creation ([ee71818](https://github.com/sphereio/commercetools-php-sdk/commit/ee71818)), closes [#203](https://github.com/sphereio/commercetools-php-sdk/issues/203)
20+
* **Product:** support availableQuantity for product variant availability ([dbc4c48](https://github.com/sphereio/commercetools-php-sdk/commit/dbc4c48)), closes [#202](https://github.com/sphereio/commercetools-php-sdk/issues/202)
21+
* **Product:** support fuzzy query for product suggest ([1d59870](https://github.com/sphereio/commercetools-php-sdk/commit/1d59870)), closes [#205](https://github.com/sphereio/commercetools-php-sdk/issues/205)
22+
* **Query:** add support for multiple where query parameters ([591c926](https://github.com/sphereio/commercetools-php-sdk/commit/591c926)), closes [#196](https://github.com/sphereio/commercetools-php-sdk/issues/196)
23+
* **Request:** support reference expansion for CRUD requests ([0f29ea7](https://github.com/sphereio/commercetools-php-sdk/commit/0f29ea7)), closes [#199](https://github.com/sphereio/commercetools-php-sdk/issues/199)
24+
* **Review:** add review messages ([f20c858](https://github.com/sphereio/commercetools-php-sdk/commit/f20c858))
25+
* **UpdateRequest:** add hasActions method to update requests ([cb98ffd](https://github.com/sphereio/commercetools-php-sdk/commit/cb98ffd))
26+
27+
28+
129
<a name="1.0.1"></a>
230
## [1.0.1](https://github.com/sphereio/commercetools-php-sdk/compare/v1.0.0...v1.0.1) (2016-05-17)
331

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ The [PHP API documentation](http://sphereio.github.io/commercetools-php-sdk/docs
1515

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

18-
The SDK requires a PHP version of 5.4 or higher with the apc(u) PHP extension for its default cache. If you provide an own Cache interface, apc(u) is not necessary.
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).
19+
1920
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.
2021
The intl extension is required to directly output Money objects as a String.
2122

@@ -115,25 +116,23 @@ xcode-select --install
115116
brew tap homebrew/dupes
116117
brew tap homebrew/versions
117118
brew tap homebrew/homebrew-php
118-
brew install php55
119-
brew install php55-intl
120-
brew install php55-apcu
121-
brew install php55-xdebug
119+
brew install php56
120+
brew install php56-intl
121+
brew install php56-xdebug
122122
brew install ant
123123
# you probably also need to fix a (=any) timezone in your php.ini:
124-
echo "date.timezone='Europe/Berlin'" >> /usr/local/etc/php/5.5/conf.d/60-user.ini
124+
echo "date.timezone='Europe/Berlin'" >> /usr/local/etc/php/5.6/conf.d/60-user.ini
125125
# initialize the dependencies:
126126
php composer.phar update
127127
```
128128

129129
### Linux preparations :
130-
* install php 5.4+, apc(u), xdebug and ant according to their distro's package system.
131-
* make sure the curl, intl, mbstring, apcu and openssl extensions are activated in php.ini
130+
* install php 5.5+, xdebug and ant according to their distro's package system.
131+
* make sure the curl, intl, mbstring and openssl extensions are activated in php.ini
132132

133133
### Windows preparations:
134-
* [install php](http://windows.php.net/download/) 5.4+, i.e. extract ZIP and make add php.exe location to your PATH. Use WAMP etc. if you like, but plain PHP commandline is all you really need (you can test example code in the built-in webserver).
134+
* [install php](http://windows.php.net/download/) 5.5+, i.e. extract ZIP and make add php.exe location to your PATH. Use WAMP etc. if you like, but plain PHP commandline is all you really need (you can test example code in the built-in webserver).
135135
* enable the curl, intl, mbstring and openssl extenstions in php.ini
136-
* [install apcu](http://robert-rusu.blogspot.de/2014/06/install-apcu-on-windows.html) OR a redis extension and server
137136
* make a working ant available in the PATH
138137
* and [install composer](https://getcomposer.org/doc/00-intro.md#installation-windows).
139138

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"guzzlehttp/guzzle": "^5.0 || ^6.0",
3030
"guzzlehttp/psr7": "^1.1",
3131
"pimple/pimple": "^3.0",
32+
"psr/cache": "^1.0",
3233
"ext-intl": "*",
3334
"ext-mbstring": "*"
3435
},
@@ -47,6 +48,8 @@
4748
"phpunit/phpcov": "*",
4849
"fabpot/php-cs-fixer": "@stable",
4950
"symfony/yaml": "*",
51+
"cache/array-adapter": "^0.4.0",
52+
"cache/filesystem-adapter": "^0.3.0",
5053
"incenteev/composer-parameter-handler": "^2.0"
5154
},
5255
"scripts": {

docroot/index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Commercetools\Core;
77

8+
use Cache\Adapter\Filesystem\FilesystemCachePool;
9+
use League\Flysystem\Adapter\Local;
10+
use League\Flysystem\Filesystem;
811
use Monolog\Handler\StreamHandler;
912
use Monolog\Logger;
1013
use Commercetools\Core\Model\Common\Context;
@@ -34,7 +37,11 @@
3437
$log = new Logger('name');
3538
$log->pushHandler(new StreamHandler('./requests.log'));
3639

37-
$client = Client::ofConfigAndLogger($config, $log);
40+
$filesystemAdapter = new Local(__DIR__.'/');
41+
$filesystem = new Filesystem($filesystemAdapter);
42+
$cache = new FilesystemCachePool($filesystem);
43+
44+
$client = Client::ofConfigCacheAndLogger($config, $cache, $log);
3845

3946
$products = $client->execute($request)->toObject();
4047

features/request/Product/ProductUpdate.feature

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,35 @@ Feature: I want to send a Product Update Request
922922
}
923923
"""
924924

925+
Scenario:
926+
Given a "product" is identified by "id" and version 1
927+
And i want to update a "product"
928+
And add the "moveImageToPosition" action to "product" with values
929+
"""
930+
{
931+
"action": "moveImageToPosition",
932+
"variantId": 1,
933+
"imageUrl": "http://example.org/image.jpg",
934+
"position": 3
935+
}
936+
"""
937+
Then the path should be "products/id"
938+
And the method should be "POST"
939+
And the request should be
940+
"""
941+
{
942+
"version": 1,
943+
"actions": [
944+
{
945+
"action": "moveImageToPosition",
946+
"variantId": 1,
947+
"imageUrl": "http://example.org/image.jpg",
948+
"position": 3
949+
}
950+
]
951+
}
952+
"""
953+
925954
Scenario:
926955
Given a "product" is identified by "id" and version 1
927956
And i want to update a "product"

set_guzzle5.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@
22
SRC='"guzzlehttp/guzzle": "^6.0"'
33
DST='"guzzlehttp/guzzle": "^5.0", "guzzlehttp/log-subscriber": "^1.0"'
44
sed -ibak -e "s|$SRC|$DST|g" composer.json
5+
6+
SRC='"cache/array-adapter": "^0.4.0",'
7+
DST=''
8+
sed -ibak -e "s|$SRC|$DST|g" composer.json
9+
10+
SRC='"cache/filesystem-adapter": "^0.3.0",'
11+
DST=''
12+
sed -ibak -e "s|$SRC|$DST|g" composer.json

src/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '1.0.1';
17+
const VERSION = '1.1';
1818

1919
/**
2020
* @var AdapterInterface

src/Cache/AbstractCacheAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Commercetools\Core\Cache;
88

99
/**
10+
* @deprecated use a PSR-6 cache adapter instead. Will be removed with v2.0
1011
* @package Commercetools\Core\Cache
1112
*/
1213
abstract class AbstractCacheAdapter implements CacheAdapterInterface

src/Cache/ApcCacheAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Commercetools\Core\Cache;
88

99
/**
10+
* @deprecated use a PSR-6 cache adapter instead. Will be removed with v2.0
1011
* @package Commercetools\Core\Cache
1112
*/
1213
class ApcCacheAdapter extends AbstractCacheAdapter

0 commit comments

Comments
 (0)