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

  • https://api.zalando.com/article-reviews
  • https://api.zalando.com/article-reviews/{reviewId}
  • https://api.zalando.com/article-reviews-summaries
  • https://api.zalando.com/article-reviews-summaries/{articleModelId}
  • https://api.zalando.com/articles
  • https://api.zalando.com/articles/ {articleId}
  • https://api.zalando.com/articles/ {articleId}/media
  • https://api.zalando.com/articles/ {articleId}/reviews
  • https://api.zalando.com/articles/ {articleId}/reviews-summary
  • https://api.zalando.com/articles/ {articleId}/units
  • https://api.zalando.com/articles/ {articleId}/units/{unitId}
  • https://api.zalando.com/brands
  • https://api.zalando.com/brands/{key}
  • https://api.zalando.com/categories
  • https://api.zalando.com/categories/{key}
  • https://api.zalando.com/domains
  • https://api.zalando.com/facets?{filters}
  • https://api.zalando.com/filters
  • https://api.zalando.com/filters/{name}
  • https://api.zalando.com/recommendations/ {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

Installation

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 InvoiceOcean.com 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 InvoiceOcean.com 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 @ https://github.com/kryap/php-invoiceocean

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:

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

Need more documentation about the InvoiceOcean API?

Visit these links:

Laravel 4 released

Great news! My favorite PHP framework Laravel finally released version 4 after 5 public beta’s and months of waiting. Why am I so happy? Well.. it makes my job as a developer a lot simpler compared to my Zend Framework days.

Here’s why you must try Laravel

  • – Smart framework: write less code (faster + easier)
  • – Works with composer, the PHP plugin tool
  • – Filters, events, rest, built-in auth, … it has it all out of the box
  • – Elequent ORM: the smartest and easiest PHP ORM today!
  • – Unit testing for all components

So what’s new in Laravel 4?

  • – L4 now runs on PHP >= 5.3.7
  • – PSR-0 code standards are used
  • – Composer (packagist.org) instead of Laravel bundles
  • – Lot’s of small but convenient little tweaks and options
  • – Mail is now built in
  • – L4 is built with Unit Testing in mind
  • – Great community!
  • – The command line tool (artisan) is now more powerful

 

Here’s what changed in L4:
https://github.com/laravel/framework

Laravel 4 introduction

Download Laravel @ http://laravel.com/, and make sure to follow them on Twitter: https://twitter.com/laravelphp