Firebase PHP SDK 2.0

I am really excited (hence the date and time :)) to announce kreait/firebase-php 2.0, as a first beta and welcome everyone willing to give it a try. Version 2.0 is a complete rewrite in PHP 7, and leverages the Firebase REST API to provide a fluent interface to your Firebase Application.

The only reason for it being a beta release is the outdated 1.x documentation, which I will start updating soon. If your IDE supports autocompletion, you should just be fine :).

Firebase PHP SDK 1.0 released, coming up: 2.0

Short Version:

firebase-logo I have never written about it here on my blog, but since last year, I have been developing a PHP SDK to access the Google Firebase Realtime Database – Firebase provides SDKs for JavaScript, iOS and Android, as well as a REST API, but with PHP being my main programming language, I was missing a PHP SDK and that’s how kreait/firebase-php was born.

I never had the feeling that the library was ready for a 1.0 release, because there were so many features to add and so much refactoring to do, but a lot has happened between Version 0.1 (Jan 9, 2015) and Version 0.10.1 (Jul 2, 2016), with the following being the most “disruptive” events:

  • In late 2015, the egeleon/ivory-http-adapter package (which my library is built upon) got deprecated, and I never got to making the switch to its successor, HTTPlug.
  • In early 2016, Firebase introduced Version 3 of their Server SDK, including a new authentication system based on the Google authentication infrastructure. Version 2 of the Firebase Server SDK is still working and maintained, but it will be shut down eventually.
  • PHP 7 was released in December 2015, and PHP 5.5 became an unsupported version in July 2016.

That’s why I started rewriting the PHP SDK some weeks ago, using PHP 7, official Google Libraries and targeted at the latest Firebase developments.

But I still felt bad about my 0.10.x being in pre-release status, so I took the last few days of my vacation to clean up the code base, prettify the documentation and make it a proper 1.0 release.

You can find the new release on the GitHub project page at and read the documentation at

I will continue to support this version at least until the release of Version 2.0, which is currently being developed in the 2.x branch of the repository.

As always, if you have any feedback or suggestions, I’d like to invite you to use the comment form below.

Troubleshooting SSH with public key authentication on Synology DSM 6.0

If SSH keeps asking you to enter your password, although you have set up Public Key Authentication, make sure that file permissions are correct:

cd ~
chown -R `whoami`:users .ssh
chmod 0700 .ssh
chmod 0600 .ssh/* 

Apparently, on a Synology DiskStation, your home dir must be neither group- nor world-writable1:

cd ~
chmod 0755 .

  1. On my DiskStation, all user directories were set to 777 – I don’t remember if this has always been the case, if I did this manually (and why :)) or if this happened during the update to DSM 6.0. 

(Obsolete) How to enable the nginx plugin for Let’s Encrypt

This post is now obsolete, please use Certbot for your SSL certificates:

In case you haven’t heard already: Let’s Encrypt is a new Certificate Authority that promises an easy way to install their free SSL certificates for any domain. As they now have opened their beta to the public, I was finally able to give it a try.

The installation steps are as easy as they can get:

git clone
cd letsencrypt
./letsencrypt-auto # will install and run the client

As I am not running Apache and the nginx plugin is not included by default1, I had to install it manually:

~/.local/share/letsencrypt/bin/pip install letsencrypt-nginx

After that, the installation was just a breeze:

./letsencrypt-auto --nginx -d

Et voilà, not even a minute later this website is now secured and it didn’t hurt at all – AWESOME!

How to apply PHP and HHVM settings on Travis CI

To inject PHP settings into the build environment, you can provide an INI file and use it with

  - phpenv config-add .travis.ini

Unfortunately, this approach can not be applied for HHVM, as the phpenv command won’t work and HHVM’s php.ini is located in a different directory.

Here is how you can inject the same INI file for both environments:

  - if [[ "$TRAVIS_PHP_VERSION" = "php*" ]]; then phpenv config-add .travis.ini ; fi
  - if [[ "$TRAVIS_PHP_VERSION" = "hhv*" ]]; then cat .travis.ini >> /etc/hhvm/php.ini ; fi

Avoid GitHub rate limits when using Composer

If you are using Composer in your project, it is quite likely that at one time, you’ve hit the GitHub rate limits which allow just 60 requests per hour to the GitHub API.

On your local computer, this can easily be bypassed by entering your GitHub login when Composer prompts you to do so, which raises the rate limits to a whopping 5,000 requests per hour. But what can you do when the Composer install/update commands don’t take place on your local machine, but on a CI Server like Travis CI and Jenkins, or during the provisioning of a Virtual Machine, where you are not able to interactively enter your login information?

In this article, I’d like to show you three ways to do so.

Continue reading Avoid GitHub rate limits when using Composer

iOS home screen rotation

I am quite happy with my iPad NanoiPhone 6 Plus. My left hand needs more time to get accustomed to the new form factor, but except that I don’t regret having let the better camera and longer battery life dominate my decision for the larger iPhone.

One thing I don’t like as much: the behavior of the home screen when rotating the device.

Continue reading iOS home screen rotation

The Developer’s Dystopian Future

I find myself more and more concerned about my future as a developer.
My tolerance for learning curves grows smaller every day. New technologies, once exciting for the sake of newness, now seem like hassles. I’m less and less tolerant of hokey marketing filled with superlatives. I value stability and clarity.

von Ed Finkler, via Marco Arment

Das ist der Grund, wieso ich trotz aller gerümpfter Nasen bei PHP bleibe – damit kenne ich mich am Besten aus und bin (in Kombination mit ein bisschen HTML, CSS und JavaScript) bis heute noch nicht eine Grenze des Machbaren gekommen.

Trotzdem mache ich mir immer wieder Gedanken darüber, wo ich in fünf oder zehn Jahren stehen werde. Bin ich dann immer noch Entwickler? Gibt es dann das Web, wie wir es heute kennen, überhaupt noch? Werde ich nicht nur älter, sondern auch immer veralteter werden? Und was dann?

Ich frage mich, ob ich den neuen Technologien deswegen so non-euphorisch begegne, weil ich keine Notwendigkeit sehe, mich näher mit ihnen zu beschäftigen. Möglicherweise bin ich pragmatisch und bleibe in den Gefilden, in denen ich mich auskenne. Bestimmt blitzt Trotz durch, wenn jemand mit mir eine Diskussion anzetteln will, wieso jemandes Programmiersprache besser/eleganter/schöner/performanter ist als meine12. Und ganz bestimmt sogar bin ich ein Gewohnheitstier, und stehe Neuem zwar aufgeschlossen, interessiert und tolerant gegenüber – aber nicht genug, dass ich von der Sicherheit des mir Vertrauten auch nur ein Stückchen abgeben würde.

In meinem aktuellen Projekt habe ich bisher noch keine Zeile Code geschrieben und beschäftige mich stattdessen mit Anforderungen, Prozessen und der Ermittlung von geeigneten Werkzeugen. Das ist neu, ich lerne viel und wenn es mir zwischendurch mal zu viel wird, suche ich Trost in der implode()-Funktion. Ich mag PHP!

  1. Diese Aussagen habe ich in genau diesem Wortlaut schon oft gehört. Meiner Meinung nach kann man in jeder Programmiersprache guten, eleganten, schönen Code schreiben, und mehr trage ich zu solchen Diskussionen auch nicht mehr bei, durch die eh noch nie jemand bekehrt worden ist. 
  2. Schöner Satz hierzu auch auf Reddit: “(a lot of) programmers are elitists, bandwagon-lovers, or just trying to fit in; PHP is an easy target […]” 

Coder’s High

The closest description of something like coder’s high from a noncoder I ever heard was from a chess player. He described how, in his most lucid moments of concentration, he could suddenly see the entire game laid out before him in his mind, all the possibilities for strategies and many of their upsides and downsides. It was beyond just a mental picture or movie, since it had more information than could be represented in any linear way.