Add common enhancements to the Doctrine default MasterSlaveConnection implementation.
-
Force all the SELECT queries go to slave databases.
-
Use a better random function
random_int
to balance the load among slave databases.
Install the package and assign this enhanced version of MasterSlaveConnection to the wrapper_class
property of doctrine
configuration.