Replica set support and read preference support.

This code has been running on 100% of our production webservers at FindTheBest for about a week now, and all of our webservers are running on NGINX/HHVM. For our use case, the Mongofill plugin has been stable and fast. We don't use Mongo heavily, but we do have at least one read and write per page request. APC was used for storing server side information replica sets, because otherwise the spec would require too many replSetGetStatus calls, and they would giving our servers a hard time. The spec says we should cache it anyway. I think APC is fine though, because HHVM natively supports apc_store/apc_fetch, and from our tests, they are insanely fast.


I wanted to use parse_url for this entire function. However, MongoDB uses a special syntax of comma-separated servers, which makes the URI invalid according to normal standards, and so parse_url does not work.

What error are you seeing here? It looks fine to me, and the test was passing.