Skip to content
Snippets Groups Projects
Commit d4cf8c28 authored by Robert Lange's avatar Robert Lange
Browse files

set path for cache dir by environment variable also

parent 3c0d072f
No related merge requests found
Pipeline #10679 passed with stage
in 12 seconds
......@@ -6,6 +6,10 @@
{
"name": "Sebastian Kehr",
"email": "kehr@ub.uni-leipzig.de"
},
{
"name": "Robert Lange",
"email": "lange@ub.uni-leipzig.de"
}
],
"autoload": {
......
......@@ -33,9 +33,12 @@ abstract class AbstractFilesystemCacheFactory
$name = $this->getName();
$config = $container->get('config')['symfony_serializer'] ?? [];
$cacheConfig = $config['caches'][$name] ?? [];
$directory = $cacheConfig['directory'] ?? $config['cache_directory'] ??
getcwd() . '/data/cache/symfony-serializer';
if (getenv('SERIALIZER_BRIDGE_CACHE_DIR')) {
$directory = getenv('SERIALIZER_BRIDGE_CACHE_DIR');
} else {
$directory = $cacheConfig['directory'] ?? $config['cache_directory'] ?? '/var/cache';
}
$lifetime = $cacheConfig['lifetime'] ?? $config['cache_lifetime'] ?? 0;
$namespace = $cacheConfig['namespace'] ?? md5($name);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment