php-zalando, a PHP client to interact with the Zalando API

zalando-logoAgain it’s been a while since I created a public PHP library to interact with another API but here we go. For a project we needed to interact with Zalando but unfortunately their API didn’t have a PHP wrapper/library to interact with it. Until now!

I present you php-zalando (packagist link) based on the Zalando API.

API endpoints covered so far

  • {articleId}
  • {articleId}/media
  • {articleId}/reviews
  • {articleId}/reviews-summary
  • {articleId}/units
  • {articleId}/units/{unitId}
  • {articleIds}

Nearly all API endpoints are covered, but there are still some items to do:
– achieve 100% code coverage (34% at the moment)
– add all optional filters/parameters, different per endpoint


Via Composer

Add php-zalando in your composer.json or create a new composer.json:

     "require": {
          "cschalenborgh/php-zalando": "dev-master"

Now tell composer to download the library by running the command:

php composer.phar install

That’s it! Because of Composer’s autoloading you should now be able to use this library. Don’t forget to include the namespace.

php-invoiceocean, a PHP client to interact with the API

It’s been a while since I created a public PHP library to interact with another API but here we go.

php-invoiceocean is a PHP client to communicatie with the API.

What is InvoicingOcean?

“The easiest way to online invoicing”. Over 70 000 companies are using the InvoiceOcean software. The application’s simplicity and intuitive interface is aimed at quick and efficient invoice issuing. Because of the SaaS environment, your data is securely stored in the Cloud and available to access from anywhere in the world. Whether you are a small or medium business owner or an individual entrepreneur, InvoiceOcean will make your work easier.

A few facts

– it’s RESTful
– works with Json exclusively (although they have XML api’s, I like Json more)
– it’s pretty smart in a way that you only have to define the method names, no parameter or http method checking
– works with composer (obviously)

Clone this repo @

How to use?

composer require kryap/php-invoiceocean
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing kryap/php-invoiceocean (dev-master a8ccf4d)
Cloning a8ccf4dfd3b8daa611087822f27da2a773c073ce
Writing lock file
Generating autoload files
Generating optimized class loader

Here’s how you could use it:

$io = new InvoiceOceanClient('username', 'api_token_goes_here');
$clients = $io->getClients();

Need more documentation about the InvoiceOcean API?

Visit these links:

Deploying PHP projects with Jenkins on OS X


Continuous deployment, automated unit testing, code analysis & reports, git repo’s, Laravel 4 using Composer. This must be a dream project right? Well, yes, if you have it working correctly. It took me a while to get everything working together but now it works like a charm. I chose to deploy via my macbook, but some people might find it handier to install this setup on a public webserver so they can bind their commits to automated deployments, use it as a team, ….
Anyway, this tutorial will be about deployment for php projects (Laravel 4 in particular) on OS X. I’m assuming you already have a webserver up & running (I’m using MAMP).

1) Install Jenkins

Go to and install Jenkins for Mac OS X, make sure to use seperate new user. Here’s a great tutorial about this:

– Jenkins in your dock:
– JenkinsMobi (iOS app):

2) Configure Jenkins

I strongly recommend you to follow this tutorial as it has almost everything documented for deploying php apps through Jenkins. My setup is actually based on this documentation.

Download the Jenkins plugins listed on the website. I’m using these:
– Jenkins Mailer Plugin
– External Monitor Job Type Plugin
– Ant Plugin
– Static Analysis Utitlities
– Checkstyle Plug-in
– Credentials Plugin
– Jenkins CVS Plug-in
– Duplicate Code Scanner Plug-in
– Jenkins Email Extension Plugin
– FTP publisher plugin
– Jenkins GIT client plugin
– Jenkins GIT plugin
– GitHub API Plugin
– Github plugin
– HTML Publisher plugin
– Jenkins JDepend Plugin
– Plot plugin
– PMD Plug-in
– Publish Over FTP
– xUnit Plugin

3) Configure a new project

Install the jenkins-php’s job template tutorial. When you want to create a new project, simply copy the job template project and modify it as you want.

4) Connect your git repo

Connect your git repo to jenkins. Make sure to use the git protocol ( if you setup key pairs. If you’re using the http:// github url it will keep asking for credentials even though your key pairs are correctly installed.

5) Install Composer

Use this tutorial to install Composer:

And put it in your bin directory so every user can use this great piece of software:

cp composer.phar /usr/local/bin/composer

If you’re using composer you will at one point notice it will clone your depency repo’s using git everytime you build your application. And this gave me some Jenkins problems.. Even though the normal ‘composer update’ worked like a charm under my jenkins user, Jenkins itself was giving problems.

[exec] [RuntimeException]
[exec] Failed to clone, git was not found, check that it is installed and in your PATH env.
[exec] sh: git: command not found

more @

To fix this, go to http://localhost:8080/configure -> Global configuration -> Environment variables
And add this:
name = PATH
value = /usr/local/git/bin:$PATH

As you can see in the following picture, composer is now fully working in our build process:

6) Install some additional PHP packages

Now of course we want code statistics, automated unit testing, auto generated API documentation, coverage reports, etc so we need to install some extra tools:

pear (
Follow this quick guide to install pear:

phpdox (

sudo pear config-set auto_discover 1
sudo pear install

phpunit (

sudo pear channel-discover
sudo pear install phpunit/PHPUnit

phploc (

sudo pear config-set auto_discover 1
sudo pear install

pdepend (

sudo pear channel-discover
sudo pear install pdepend/PHP_Depend-beta


sudo pear channel-discover
sudo pear install --alldeps phpqatools/PHP_CodeBrowser

7) Create your build file

Next we create our build.xml file and we make sure it’s executed correctly by Jenkins (check Project -> Building steps). Put this file in your /jobs/PROJECT directory.

Here’s mine:

Note: you can test the build file manually by executing this command. So no need to build via Jenkins and download 24 composer repo’s before it starts executing the ant build file.

ant -f build.xml -v

You will also need some additional XML config files:

PROJECT/phpcs.xml ->

PROJECT/phpdox.xml ->

PROJECT/phpmd.xml ->

You will also have to alter your Laravel’s phpunit.xml file: (the one in your root folder)

8) Build your application

Now try to build your application through Jenkins. Enjoy!

Here’s how it should look like:

And some fancy screenshots:


These are just some Jenkins screenshots.. our build file is also generating documentation, code coverage, getc which you can find in PROJECT/workspace/build/ and PROJECT/build

Interesting links: