PHP implementation of server-driven negotiation