Code developed during the "Advanced PHP Development" training before ConFoo 2013