From 46c6f4e16469ebb1f3dec1681d718b6ae85051c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Pudil?= Date: Fri, 15 Jun 2018 13:07:17 +0200 Subject: [PATCH] OrmAnnotationsExtension: enhance cache driver configuration --- src/DI/OrmAnnotationsExtension.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DI/OrmAnnotationsExtension.php b/src/DI/OrmAnnotationsExtension.php index 43b6c69..fb4a9db 100644 --- a/src/DI/OrmAnnotationsExtension.php +++ b/src/DI/OrmAnnotationsExtension.php @@ -54,8 +54,13 @@ public function loadConfiguration(): void } // Cache - $builder->addDefinition($this->prefix('annotationsCache')) - ->setFactory($config['cache'], [Helpers::expand($config['cacheDir'], $builder->parameters)]); + $cache = $builder->addDefinition($this->prefix('annotationsCache')) + ->setFactory($config['cache']) + ->setAutowired(false); + + if ($config['cache'] === FilesystemCache::class) { + $cache->setArguments([Helpers::expand($config['cacheDir'], $builder->parameters)]); + } //TODO otestovat predani @...