+// REDIS - Split out configuration into an array
+if (env('REDIS_SERVERS', false)) {
+ $redisServerKeys = ['host', 'port', 'database'];
+ $redisServers = explode(',', trim(env('REDIS_SERVERS', '127.0.0.1:6379:0'), ','));
+ $redisConfig = [
+ 'cluster' => 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);
+ }
+}
+
+$mysql_host = env('DB_HOST', 'localhost');
+$mysql_host_exploded = explode(':', $mysql_host);
+$mysql_port = env('DB_PORT', 3306);
+if (count($mysql_host_exploded) > 1) {
+ $mysql_host = $mysql_host_exploded[0];
+ $mysql_port = intval($mysql_host_exploded[1]);
+}
+