Created
March 14, 2020 16:18
-
-
Save serefercelik/9dadc94c7579a7ad37e987341a59b3f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before returning the database configuration, place read hosts into an array. | |
$readHosts = ['193.168.1.1', '194.168.1.1']; | |
// | |
'mysql' => array( | |
'read' => array( | |
// Return a random host | |
'host' => $readHosts[array_rand($readHosts)], | |
), | |
'write' => array( | |
'host' => '196.168.1.2' | |
), | |
'driver' => 'mysql', | |
'database' => 'database', | |
'username' => 'root', | |
'password' => '', | |
'charset' => 'utf8', | |
'collation' => 'utf8_unicode_ci', | |
'prefix' => '', | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment