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

Commit a1b17e8

Browse files
author
Jens Schulze
committed
Merge branch 'release/RC2'
2 parents 1f77527 + 823e566 commit a1b17e8

File tree

676 files changed

+4123
-4035
lines changed

Some content is hidden

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

676 files changed

+4123
-4035
lines changed

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
<a name"1.0.0-RC2"></a>
2+
### 1.0.0-RC2 (2015-08-03)
3+
4+
5+
#### Bug Fixes
6+
7+
* **ProductVariantDraft:** add images definition ([971cfbf4](https://github.com/sphereio/commercetools-php-sdk/commit/971cfbf4), closes [#135](https://github.com/sphereio/commercetools-php-sdk/issues/135))
8+
9+
10+
#### Breaking Changes
11+
12+
* SphereException and SphereServiceException have been renamed to ApiException and ApiServiceException
13+
14+
Before
15+
```
16+
try {
17+
...
18+
} catch(SphereException $e) {
19+
}
20+
```
21+
22+
After:
23+
24+
```
25+
try {
26+
...
27+
} catch(ApiException $e) {
28+
}
29+
```
30+
31+
([813a6cb7](https://github.com/sphereio/commercetools-php-sdk/commit/813a6cb7))
32+
* Namespace Sphere has been renamed to Commercetools
33+
34+
Namespace and Use statements and fully qualified class names have to be adjusted. E.g.
35+
36+
Before
37+
```
38+
use Sphere\Core\Client;
39+
40+
$class = '\Sphere\Core\Client';
41+
```
42+
43+
After:
44+
45+
```
46+
use Commercetools\Core\Client;
47+
48+
$class = '\Commercetools\Core\Client';
49+
```
50+
51+
([4bc9575f](https://github.com/sphereio/commercetools-php-sdk/commit/4bc9575f))
52+
53+
154
<a name"1.0.0-RC1"></a>
255
### 1.0.0-RC1 (2015-07-27)
356

README.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
![SPHERE.IO icon](https://admin.sphere.io/assets/images/sphere_logo_rgb_long.png)
2-
# SPHERE.IO PHP SDK
1+
# <img src="build/theme/resources/CT_cube_200px.png" width="40" align="center"></img> commercetools PHP SDK
32

4-
> STATUS: Release Candidate 1. We have done all planned breaking changes and ask you to really use this API thoroughly now, especially the API design and object structure. Thank you very much!
5-
>
6-
> See the [Milestone Plan](https://github.com/sphereio/sphere-php-sdk/milestones?direction=desc&sort=completeness&state=open) for details of what's planned in detail. We love feedback and [Issue reports](https://github.com/sphereio/sphere-php-sdk/issues?q=is%3Aopen+is%3Aissue+sort%3Acreated-asc)!
3+
> STATUS: Release Candidate 1. We have done all planned breaking changes and ask you to really use this API thoroughly now, especially the API design and object structure. Thank you very much!
4+
>
5+
> See the [Milestone Plan](https://github.com/sphereio/commercetools-php-sdk/milestones?direction=desc&sort=completeness&state=open) for details of what's planned in detail. We love feedback and [Issue reports](https://github.com/sphereio/commercetools-php-sdk/issues?q=is%3Aopen+is%3Aissue+sort%3Acreated-asc)!
6+
> Up-to-Date planning status can be found on this [Waffle Board](https://waffle.io/sphereio/commercetools-php-sdk)
77
8-
[![Build Status](https://img.shields.io/travis/sphereio/sphere-php-sdk/master.svg?style=flat-square)](https://travis-ci.org/sphereio/sphere-php-sdk) [![Scrutinizer](https://img.shields.io/scrutinizer/g/sphereio/sphere-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/sphereio/sphere-php-sdk/) [![Scrutinizer](https://img.shields.io/scrutinizer/coverage/g/sphereio/sphere-php-sdk.svg?style=flat-square)](https://scrutinizer-ci.com/g/sphereio/sphere-php-sdk/) [![Packagist](https://img.shields.io/packagist/v/sphere/php-sdk.svg?style=flat-square)](https://packagist.org/packages/sphere/php-sdk) [![Packagist](https://img.shields.io/packagist/dm/sphere/php-sdk.svg?style=flat-square)](https://packagist.org/packages/sphere/php-sdk)
8+
[![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/sphere/php-sdk.svg?style=flat-square)](https://packagist.org/packages/sphere/php-sdk) [![Packagist](https://img.shields.io/packagist/dm/sphere/php-sdk.svg?style=flat-square)](https://packagist.org/packages/commercetools/php-sdk)
99

10-
The PHP SDK allows developers to build applications on the SPHERE.IO REST API using PHP native interfaces, models and helpers instead of manually using the HTTP and JSON API. You gain lots of IDE Auto-Completion, type checks on a literal API, Warnings, Object Mapping, i18n support etc..
11-
It also manages the OAuth2 security, provides caches and an interface for concurrent and asynchronous API calls.
10+
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.
11+
12+
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.
1213

1314
The SDK is licensed under the permissive [MIT License](LICENSE). Don't hesitate to [contribute](#contribute)!
1415

1516

1617
## Using the SDK
1718

18-
The [PHP API documentation](http://sphereio.github.io/sphere-php-sdk/docs/master) provides all the details you need in a searchable form (link points to latest stable release).
19+
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).
1920

2021
### Install & Integrate the SDK into your Project
2122

@@ -36,13 +37,26 @@ Next, run the Composer command to install the latest version of the SDK:
3637
composer require sphere/php-sdk dev-master
3738
```
3839

40+
The SDK supports Guzzle6 as well as Guzzle5 as HTTP client. For Guzzle6:
41+
42+
```bash
43+
composer require guzzlehttp/guzzle ^6.0
44+
```
45+
46+
When you want to use Guzzle5 you have to add additionally the log subscriber:
47+
48+
```bash
49+
composer require guzzlehttp/guzzle ^5.0
50+
composer require guzzlehttp/log-subscriber ^1.0
51+
```
52+
3953
After installing, you need to require Composer's autoloader if that's not yet the case:
4054

4155
```php
4256
require 'vendor/autoload.php';
4357
```
4458

45-
If you don't use Composer, just [download a zip archive](https://github.com/sphereio/sphere-php-sdk/archive/master.zip) of the latest release, manually integrate it and configure your own autoloader.
59+
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.
4660

4761
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.
4862

@@ -52,15 +66,15 @@ Please read the [Changelog](CHANGELOG.md) before updating in any case.
5266

5367
### Getting started
5468

55-
To get up and running, [create a free test project](http://admin.sphere.io) to get a SPHERE project with API credentials (Menu "Developers"->"API Clients").
69+
To get up and running, [create a free test project](http://admin.sphere.io) on the commercetools platform with API credentials (Menu "Developers"->"API Clients").
5670

5771
```php
5872
<?php
5973

6074
require '../vendor/autoload.php';
6175

62-
use Sphere\Core\Request\Products\ProductProjectionSearchRequest;
63-
use Sphere\Core\Client;
76+
use Commercetools\Core\Request\Products\ProductProjectionSearchRequest;
77+
use Commercetools\Core\Client;
6478

6579
$config = [
6680
'client_id' => 'my client id',
@@ -114,22 +128,22 @@ php composer.phar update
114128
```
115129

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

120134
### Windows preparations:
121135
* [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).
122136
* enable the curl, intl, mbstring and openssl extenstions in php.ini
123137
* [install apcu](http://robert-rusu.blogspot.de/2014/06/install-apcu-on-windows.html) OR a redis extension and server
124-
* make a working ant available in the PATH
125-
* and [install composer](https://getcomposer.org/doc/00-intro.md#installation-windows).
138+
* make a working ant available in the PATH
139+
* and [install composer](https://getcomposer.org/doc/00-intro.md#installation-windows).
126140

127141
### Start working:
128142

129143
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):
130144

131145
```
132-
git clone [email protected]:sphereio/sphere-php-sdk.git
146+
git clone [email protected]:sphereio/commercetools-php-sdk.git
133147
```
134148

135149
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).
@@ -145,7 +159,7 @@ ant
145159
You can use the `docroot` directory with the built-in PHP web server. Add to the docroot directory a file called "myapp.ini". Add following content and setup with your API credentials:
146160

147161
```ini
148-
[sphere]
162+
[commercetools]
149163
client_id = 'my client id'
150164
client_secret = 'my client secret'
151165
project = 'my project id'

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project name="sphere-php-sdk" default="build">
2+
<project name="commercetools-php-sdk" default="build">
33
<!-- By default, we assume all tools to be on the $PATH -->
44
<property name="toolsdir" value="vendor/bin/"/>
55

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/sphere-php-sdk/docs/master
2+
baseUrl: http://sphereio.github.io/commercetools-php-sdk/docs/master
33

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

build/theme/overview.latte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
<div class="element-list container-fluid">
1414
<div class="row">
1515
<div class="col-md-3">
16-
<a class="btn btn-default btn-lg btn-block lead" href="class-Sphere.Core.Client.html" role="button">Client</a>
16+
<a class="btn btn-default btn-lg btn-block lead" href="class-Commercetools.Core.Client.html" role="button">Client</a>
1717
</div>
1818
<div class="col-md-3">
19-
<a class="btn btn-default btn-lg btn-block lead" href="class-Sphere.Core.Config.html" role="button">Config</a>
19+
<a class="btn btn-default btn-lg btn-block lead" href="class-Commercetools.Core.Config.html" role="button">Config</a>
2020
</div>
2121
<div class="col-md-3">
22-
<a class="btn btn-default btn-lg btn-block lead" href="class-Sphere.Core.Model.Common.Context.html" role="button">Context</a>
22+
<a class="btn btn-default btn-lg btn-block lead" href="class-Commercetools.Core.Model.Common.Context.html" role="button">Context</a>
2323
</div>
2424
</div>
2525
</div>
21.3 KB
Loading

composer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "sphere/php-sdk",
2+
"name": "commercetools/php-sdk",
33
"license": "MIT",
44
"type": "project",
5-
"description": "The Sphere.IO PHP SDK",
6-
"homepage": "https://github.com/sphereio/sphere-php-sdk",
5+
"description": "The commercetools PHP SDK \n The official PHP Interface to the commercetools eCommerce API",
6+
"homepage": "https://github.com/sphereio/commercetools-php-sdk",
77
"support": {
88
"email": "[email protected]",
99
"forum": "http://support.sphere.io",
10-
"issues": "https://github.com/sphereio/sphere-php-sdk/issues",
11-
"docs": "http://sphereio.github.io/sphere-php-sdk/docs/master/"
10+
"issues": "https://github.com/sphereio/commercetools-php-sdk/issues",
11+
"docs": "http://sphereio.github.io/commercetools-php-sdk/docs/master/"
1212
},
1313
"autoload": {
1414
"psr-4": {
15-
"Sphere\\Core\\": "src/"
15+
"Commercetools\\Core\\": "src/"
1616
}
1717
},
1818
"autoload-dev": {
1919
"psr-4": {
20-
"Sphere\\Core\\": [
20+
"Commercetools\\Core\\": [
2121
"tests/unit/",
2222
"tests/integration/"
2323
]
@@ -45,8 +45,5 @@
4545
"behat/behat": "^3.0",
4646
"phpspec/prophecy-phpunit": "^1.0",
4747
"phpunit/phpcov": "*"
48-
},
49-
"suggest": {
50-
"ext-intl": "for convenient handling of localizations"
5148
}
5249
}

docroot/annotations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* @author @ct-jensschulze <[email protected]>
44
*/
55

6-
namespace Sphere\Core;
6+
namespace Commercetools\Core;
77

8-
use Sphere\Core\Helper\Annotate\AnnotationGenerator;
8+
use Commercetools\Core\Helper\Annotate\AnnotationGenerator;
99

1010
require '../vendor/autoload.php';
1111

docroot/index.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
* @author @ct-jensschulze <[email protected]>
44
* @created: 04.02.15, 13:31
55
*/
6-
namespace Sphere\Core;
6+
namespace Commercetools\Core;
77

88
use Monolog\Handler\StreamHandler;
99
use Monolog\Logger;
10-
use Sphere\Core\Model\Common\Context;
11-
use Sphere\Core\Model\Product\ProductProjection;
12-
use Sphere\Core\Model\Product\ProductProjectionCollection;
13-
use Sphere\Core\Request\Products\ProductProjectionSearchRequest;
10+
use Commercetools\Core\Model\Common\Context;
11+
use Commercetools\Core\Model\Product\ProductProjection;
12+
use Commercetools\Core\Model\Product\ProductProjectionCollection;
13+
use Commercetools\Core\Request\Products\ProductProjectionSearchRequest;
1414

1515
require '../vendor/autoload.php';
1616

1717
$appConfig = parse_ini_file('myapp.ini', true);
1818

1919
$context = Context::of()->setLanguages(['en'])->setGraceful(true);
2020

21-
// create the sphere config object
22-
$config = new Config();
23-
$config->fromArray($appConfig['sphere'])->setContext($context);
21+
// create the api client config object
22+
$config = Config::fromArray($appConfig['commercetools'])->setContext($context);
2423

2524
/**
2625
* create search request
@@ -35,7 +34,7 @@
3534
$log = new Logger('name');
3635
$log->pushHandler(new StreamHandler('./requests.log'));
3736

38-
$client = new Client($config, null, $log);
37+
$client = Client::ofConfigAndLogger($config, $log);
3938

4039
$products = $client->execute($request)->toObject();
4140

@@ -45,7 +44,7 @@
4544
?>
4645
<html>
4746
<head>
48-
<title>Sphere PHP SDK example</title>
47+
<title>Commercetools PHP SDK example</title>
4948
</head>
5049
<body>
5150
<form method="POST" action=".">

0 commit comments

Comments
 (0)