Skip to content
Permalink
Browse files

formatting

  • Loading branch information...
taylorotwell committed May 27, 2019
1 parent 8b5ddbc commit f4cfb3287b358b41735072895a485f8e68c1c7f0
Showing with 18 additions and 7 deletions.
  1. +10 −0 src/Illuminate/Database/ConfigurationUrlParser.php
  2. +8 −7 src/Illuminate/Redis/RedisManager.php
@@ -0,0 +1,10 @@
<?php
namespace Illuminate\Database;
use Illuminate\Support\ConfigurationUrlParser as BaseConfigurationUrlParser;
class ConfigurationUrlParser extends BaseConfigurationUrlParser
{
//
}
@@ -97,7 +97,8 @@ public function resolve($name = null)
if (isset($this->config[$name])) {
return $this->connector()->connect(
$this->parseConnectionConfigWithUrl($this->config[$name]), $options
$this->parseConnectionConfiguration($this->config[$name]),
$options
);
}
@@ -117,7 +118,7 @@ public function resolve($name = null)
protected function resolveCluster($name)
{
return $this->connector()->connectToCluster(
$this->parseConnectionConfigWithUrl($this->config['clusters'][$name]),
$this->parseConnectionConfiguration($this->config['clusters'][$name]),
$this->config['clusters']['options'] ?? [],
$this->config['options'] ?? []
);
@@ -157,16 +158,16 @@ protected function connector()
}
/**
* Parse the redis configuration, hydrating options using a redis configuration URL if possible.
* Parse the Redis connection configuration.
*
* @param array $config
* @param mixed $config
* @return array
*/
protected function parseConnectionConfigWithUrl($config)
protected function parseConnectionConfiguration($config)
{
$parsedConfig = (new ConfigurationUrlParser)->parseConfiguration($config);
$parsed = (new ConfigurationUrlParser)->parseConfiguration($config);
return array_filter($parsedConfig, function ($key) {
return array_filter($parsed, function ($key) {
return ! in_array($key, ['driver', 'username']);
}, ARRAY_FILTER_USE_KEY);
}

0 comments on commit f4cfb32

Please sign in to comment.
You can’t perform that action at this time.