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

Commit 8dfa2ce

Browse files
author
Jens Schulze
committed
Merge release 2.0.0
1 parent 257e1fc commit 8dfa2ce

File tree

964 files changed

+1581
-424
lines changed

Some content is hidden

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

964 files changed

+1581
-424
lines changed

CHANGELOG.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
<a name="2.0.0"></a>
2+
# [2.0.0](https://github.com/commercetools/commercetools-php-sdk/compare/v1.7.0...v2.0.0) (2017-05-31)
3+
4+
5+
### Bug Fixes
6+
7+
* **AssetDraft:** correct type for custom field object ([abc0afd](https://github.com/commercetools/commercetools-php-sdk/commit/abc0afd))
8+
* **Collection:** fix iterator for unset elements of collections (#307) ([5687380](https://github.com/commercetools/commercetools-php-sdk/commit/5687380)), closes [#307](https://github.com/issues/307)
9+
* **Customer:** fix create email token request with TTL ([8367ef6](https://github.com/commercetools/commercetools-php-sdk/commit/8367ef6))
10+
* **ImageUpload:** fix product image upload ([445b2f4](https://github.com/commercetools/commercetools-php-sdk/commit/445b2f4))
11+
* **ProductSuggest:** fix suggestion parameters ([d9652df](https://github.com/commercetools/commercetools-php-sdk/commit/d9652df)), closes [#310](https://github.com/commercetools/commercetools-php-sdk/issues/310)
12+
13+
### Code Refactoring
14+
15+
* **OAuth:** change scope of getCacheAdapter method ([c6b27ec](https://github.com/commercetools/commercetools-php-sdk/commit/c6b27ec))
16+
* **ProductSearch:** disable markMatchingVariants by default ([41711a8](https://github.com/commercetools/commercetools-php-sdk/commit/41711a8))
17+
18+
### Features
19+
20+
* **Cache:** support PSR-16 cache implementations ([c3ceac7](https://github.com/commercetools/commercetools-php-sdk/commit/c3ceac7)), closes [#297](https://github.com/commercetools/commercetools-php-sdk/issues/297)
21+
* **Client:** add logLevel configuration option ([8aa457a](https://github.com/commercetools/commercetools-php-sdk/commit/8aa457a)), closes [#300](https://github.com/commercetools/commercetools-php-sdk/issues/300)
22+
* **Client:** add possibility for additional headers when executing request ([74c5a15](https://github.com/commercetools/commercetools-php-sdk/commit/74c5a15))
23+
* **ShoppingList:** add SetDeleteDaysAfterLastModificationAction ([d31b839](https://github.com/commercetools/commercetools-php-sdk/commit/d31b839))
24+
* **Subscription:** add getter for message to message subscription payload ([daa2558](https://github.com/commercetools/commercetools-php-sdk/commit/daa2558)), closes [#308](https://github.com/commercetools/commercetools-php-sdk/issues/308)
25+
26+
27+
### BREAKING CHANGES
28+
29+
* PHP minimum version is now 5.6
30+
* guzzle/log-subscriber has been removed as a dependency
31+
* AssetDraft: AssetDraft requires CustomFieldObjectDraft instead of CustomFieldObject
32+
33+
Before:
34+
35+
```
36+
$assetDraft = AssetDraft::of()->setCustom(CustomFieldObject::of());
37+
```
38+
39+
After:
40+
41+
```
42+
$assetDraft = AssetDraft::of()->setCustom(CustomFieldObjectDraft::of());
43+
```
44+
* OAuth: Manager::getCacheAdapter() method scope has been changed from public to protected
45+
* ProductSearch: markMatchingVariants has been disabled by default
46+
47+
For performance reasons the markMatchingVariants flag has been disabled by default. In order to use markMatchingVariants feature please enable it explicit.
48+
49+
Before:
50+
```
51+
$request = ProductProjectionSearchRequest::of();
52+
```
53+
54+
After:
55+
```
56+
$request = ProductProjectionSearchRequest::of()->markMatchingVariants(true);
57+
```
58+
* Token caching is now using [PSR-6](https://packagist.org/providers/psr/cache-implementation) or [PSR-16](https://packagist.org/providers/psr/simple-cache-implementation) cache adapters only.
59+
Removed classes:
60+
- AbstractCacheAdapter
61+
- ApcCacheAdapter
62+
- ApcuCacheAdapter
63+
- CacheAdapterInterface
64+
- DoctrineCacheAdapter
65+
- NullCacheAdapter
66+
- PhpRedisCacheAdapter
67+
68+
Use an appropiate PSR-6 or PRS-16 cache adapter as a replacement. The SDK uses the [cache\apcu-adapter](https://packagist.org/packages/cache/apcu-adapter) as default or if available the [cache\filesystem-adapter](https://packagist.org/packages/cache/filesystem-adapter)
69+
* Deprecations have been removed
70+
- FileRequest
71+
- use FileUploadRequest
72+
- CustomerChangeNameAction
73+
- use CustomerSetFirstNameAction, CustomerSetLastNameAction, CustomerSetMiddleNameAction or CustomerSetTitleAction
74+
- ProductSetSkuNotStageableAction
75+
- use ProductSetSkuAction
76+
* Context doesn't extend Pimple\Container anymore
77+
* Pimple has been removed as a dependency
78+
79+
### DEPRECATION NOTE
80+
81+
The class ```Commercetools\Commons\Helper\PriceFinder``` has been deprecated. Please use the
82+
[price selection](http://dev.commercetools.com/http-api-projects-products.html#price-selection) functionality of
83+
the platform. E.g. ```ProductProjectionSearchRequest::of()->currency('EUR')->country('DE')```
84+
85+
186
<a name="2.0.0-RC1"></a>
287
# [2.0.0-RC1](https://github.com/commercetools/commercetools-php-sdk/compare/v1.7.0...v2.0.0-RC1) (2017-03-13)
388

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The [PHP API documentation](http://commercetools.github.io/commercetools-php-sdk
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://commercetools.github.io/commercetools-php-sdk/docs/master/class-Commercetools.Core.Client.html).
18+
The SDK requires a PHP version of 5.6 or higher. The SDK tries to use the APC(u) as it's default cache. If you provide a [PSR-6](https://packagist.org/providers/psr/cache-implementation) or [PSR-16](https://packagist.org/providers/psr/simple-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.
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.
@@ -39,11 +39,11 @@ The SDK supports Guzzle6 as well as Guzzle5 as HTTP client. For Guzzle6:
3939
composer require guzzlehttp/guzzle ^6.0
4040
```
4141

42-
When you want to use Guzzle5 you have to add additionally the log subscriber:
42+
When you want to use Guzzle5 you have to ensure react/promise at minimum version 2.2:
4343

4444
```bash
45-
composer require guzzlehttp/guzzle ^5.0
46-
composer require guzzlehttp/log-subscriber ^1.0
45+
composer require guzzlehttp/guzzle ^5.3.1
46+
composer require react/promise ^2.2
4747
```
4848

4949
After installing, you need to require Composer's autoloader if that's not yet the case:
@@ -54,7 +54,7 @@ require 'vendor/autoload.php';
5454

5555
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

57-
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.
57+
The project follows the [semantic versioning](http://semver.org) guidelines, i.e. everything but major version changes are backwards-compatible. This matches composer's default behavior.
5858

5959
With composer just run `composer update commercetools/php-sdk` to update to compatible versions. Edit your `composer.json` file to update to incompatible versions.
6060

@@ -101,7 +101,6 @@ foreach ($products as $product) {
101101
echo $product->getName()->en . '<br/>';
102102
}
103103

104-
?>
105104
```
106105

107106
In real world, you will not put your API credentials directly into code but use a config file or your framework's config or dependency injection system for that.
@@ -127,11 +126,11 @@ php composer.phar update
127126
```
128127

129128
### Linux preparations :
130-
* install php 5.5+, xdebug and ant according to their distro's package system.
129+
* install php 5.6+, xdebug and ant according to their distro's package system.
131130
* make sure the curl, intl, mbstring and openssl extensions are activated in php.ini
132131

133132
### Windows preparations:
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).
133+
* [install php](http://windows.php.net/download/) 5.6+, 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).
135134
* enable the curl, intl, mbstring and openssl extenstions in php.ini
136135
* make a working ant available in the PATH
137136
* and [install composer](https://getcomposer.org/doc/00-intro.md#installation-windows).
@@ -158,9 +157,9 @@ You can use the `docroot` directory with the built-in PHP web server. Add to the
158157

159158
```yaml
160159
parameters:
161-
client_id: my client id
162-
client_secret: my client secret
163-
project: my project id
160+
client_id: my client id
161+
client_secret: my client secret
162+
project: my project id
164163
```
165164
166165
Then activate the php builtin web server

build/apigen.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ templateConfig: build/theme/config.neon
88
accessLevels: [public]
99
extensions: [php]
1010

11-
deprecated: Yes
1211
internal: No
1312

1413
download: No
1514
php: No
1615
noSourceCode: No
17-
todo: No
1816
tree: Yes

build/theme/@layout.latte

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@
66
<meta charset="utf-8">
77
<meta name="robots" content="noindex" n:if="!$robots">
88

9-
<title>CTP SDK {getenv('SDK_VERSION')}: {include title}{if 'overview' !== $active && $config->title}{/if}</title>
9+
<title>CTP SDK {getenv('SDK_VERSION')}: {include title}{if 'overview' !== $active && $config->title} | {$config->title}{/if}</title>
1010

1111
<link rel="stylesheet" href="{='resources/bootstrap.min.css'|staticFile}">
1212
<link rel="stylesheet" href="{='resources/style.css'|staticFile}">
1313
<link n:if="$config->googleCseId" rel="search" type="application/opensearchdescription+xml" title="{$config->title}" href="{$config->baseUrl}/opensearch.xml">
1414
<link rel="shortcut icon" type="image/png" href="{='resources/favicon.png'|staticFile}">
1515
<script n:if="$config->googleAnalytics">
16-
var _gaq = _gaq || [];
17-
_gaq.push(['_setAccount', {$config->googleAnalytics}]);
18-
_gaq.push(['_trackPageview']);
19-
20-
(function() {
21-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
22-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
23-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
24-
})();
16+
(function(i,s,o,g,r,a,m) { i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
17+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
18+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
19+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
20+
21+
ga('create', {$config->googleAnalytics}, 'auto');
22+
ga('send', 'pageview');
2523
</script>
2624
</head>
2725

0 commit comments

Comments
 (0)