php version of https://github.com/destroytoday/uptime