This gets into the territory of including PHP-related stuff as well (which is tempting). Deserves more thought.