Auth in PHP: Bearer Tokens, HTTP Basic, and Your Custom Adapter
The MongrelDB PHP client mirrors the daemon's two auth modes with one constructor argument each, and anything more exotic, from per-request token vending to signing proxies, goes behind a one-method TransportInterface you control.