mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-28 16:36:26 +00:00
Introduce a REDIS_URL
This commit is contained in:
parent
9a95f55b9c
commit
eec4a9ab72
2 changed files with 27 additions and 6 deletions
|
@ -77,6 +77,7 @@ class AppKernel extends Kernel
|
|||
|
||||
$loader->load(function (ContainerBuilder $container) {
|
||||
$this->processDatabaseParameters($container);
|
||||
$this->defineRedisUrlEnvVar($container);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -112,4 +113,29 @@ class AppKernel extends Kernel
|
|||
$container->setParameter('database_port', (string) $container->getParameter('database_port'));
|
||||
$container->setParameter('database_socket', (string) $container->getParameter('database_socket'));
|
||||
}
|
||||
|
||||
private function defineRedisUrlEnvVar(ContainerBuilder $container)
|
||||
{
|
||||
$scheme = $container->getParameter('redis_scheme');
|
||||
$host = $container->getParameter('redis_host');
|
||||
$port = $container->getParameter('redis_port');
|
||||
$path = $container->getParameter('redis_path');
|
||||
$password = $container->getParameter('redis_password');
|
||||
|
||||
$url = $scheme . '://';
|
||||
|
||||
if ($password) {
|
||||
$url .= $password . '@';
|
||||
}
|
||||
|
||||
$url .= $host;
|
||||
|
||||
if ($port) {
|
||||
$url .= ':' . $port;
|
||||
}
|
||||
|
||||
$url .= '/' . ltrim($path, '/');
|
||||
|
||||
$container->setParameter('env(REDIS_URL)', $url);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,12 +248,7 @@ services:
|
|||
|
||||
Predis\Client:
|
||||
arguments:
|
||||
$parameters:
|
||||
scheme: '%redis_scheme%'
|
||||
host: '%redis_host%'
|
||||
port: '%redis_port%'
|
||||
path: '%redis_path%'
|
||||
password: '%redis_password%'
|
||||
$parameters: '%env(REDIS_URL)%'
|
||||
|
||||
Wallabag\Event\Subscriber\SQLiteCascadeDeleteSubscriber:
|
||||
tags:
|
||||
|
|
Loading…
Reference in a new issue