mongodb/mongo-php-driver — pull request #58 by butter5 (2012-03-21 16:30:57+00:00)
Title: Send count/distinct commands to a slave.

Having all of the counts/distinct commands going to our primary was causing flapping between the primary and secondaries. This commit addresses that by working out the command that is being used and setting slave_okay = 1 if it's a count or a distinct.

Both contributors to this are not C developers and have never worked on PHP modules before, so, if you are to merge, please check the changes carefully.
Initially testing on our cloud environment showed it working as we intended.