PHP class for http access using curl