Haller.js ported to PHP