X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/eaa1765c7a68cd671bcb37a666203210bf05d217..refs/pull/263/head:/config/database.php diff --git a/config/database.php b/config/database.php index f6cf86b4c..832852dc2 100644 --- a/config/database.php +++ b/config/database.php @@ -1,5 +1,21 @@ env('REDIS_CLUSTER', false) + ]; + foreach ($redisServers as $index => $redisServer) { + $redisServerName = ($index === 0) ? 'default' : 'redis-server-' . $index; + $redisServerDetails = explode(':', $redisServer); + if (count($redisServerDetails) < 2) $redisServerDetails[] = '6379'; + if (count($redisServerDetails) < 3) $redisServerDetails[] = '0'; + $redisConfig[$redisServerName] = array_combine($redisServerKeys, $redisServerDetails); + } +} + return [ /* @@ -64,6 +80,18 @@ return [ 'strict' => false, ], + 'mysql_testing' => [ + 'driver' => 'mysql', + 'host' => 'localhost', + 'database' => 'bookstack-test', + 'username' => env('MYSQL_USER', 'bookstack-test'), + 'password' => env('MYSQL_PASSWORD', 'bookstack-test'), + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + ], + 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', 'localhost'), @@ -111,16 +139,6 @@ return [ | */ - 'redis' => [ - - 'cluster' => false, - - 'default' => [ - 'host' => '127.0.0.1', - 'port' => 6379, - 'database' => 0, - ], - - ], + 'redis' => env('REDIS_SERVERS', false) ? $redisConfig : [], ];