Code for an old PHP project