1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00

Add support for multiple randomly selected DB readers (config.php file updates)

This commit is contained in:
Ryan Cramer
2021-04-19 09:48:04 -04:00
parent fb0e7f2ecf
commit 7f91cad42f
2 changed files with 14 additions and 1 deletions

View File

@@ -1229,6 +1229,14 @@ $config->dbStripMB4 = false;
* if($config->requestMethod('GET') && !$config->requestPath($skipPaths)) {
* $config->dbReader = [ 'host' => 'readonly.mydb.domain.com' ];
* }
*
* // to have PW randomly select from multiple DB readers, nest the arrays (3.0.176+)
* // if a connection fails, PW will try another randomly till it finds one that works
* $config->dbReader = [
* [ 'host' => 'mydb1.domain.com' ],
* [ 'host' => 'mydb2.domain.com' ],
* [ 'host' => 'mydb3.domain.com' ],
* ];
* ~~~~~
*
* @var array