Closed
Description
framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php
Lines 27 to 29 in a106b93
Inside config/database.php
I have such configuration:
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', false),
'prefix' => env(
'REDIS_PREFIX',
Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'
),
],
//...
'dev_consumer' => [
'url' => env('REDIS_DEV_CONSUMER_URL'),
'host' => env('REDIS_DEV_CONSUMER_HOST', '127.0.0.1'),
'password' => env('REDIS_DEV_CONSUMER_PASSWORD', null),
'port' => env('REDIS_DEV_CONSUMER_PORT', '6379'),
'database' => env('REDIS_DEV_CONSUMER_DB', '0'),
'timeout' => 15,
'persistent' => 0,
'prefix' => 'other_name_database_',
]
],
and I expect that the prefix
option('other_name_database') from the dev_consumer
connection will override the prefix
option from the options
array.
But it doesn't happen 😢.
If I'm correct method should look like:
public function connect(array $config, array $options)
{
$connector = function () use ($config, $options) {
return $this->createClient(array_merge(
$options, $config, Arr::pull($config, 'options', [])
));
};
return new PhpRedisConnection($connector(), $connector, $config);
}
but I'm not sure what it might affect.
Metadata
Metadata
Assignees
Labels
No labels