From ba9ff5d807c91c353e8ed82cf376501c51eb851c Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Fri, 25 Jul 2014 16:59:26 +0200 Subject: [PATCH] PHRAS-197 #fix add possibility to override cache namespace --- lib/Alchemy/Phrasea/Cache/Manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php index 4f97c3f4c2..462cb9ebb8 100644 --- a/lib/Alchemy/Phrasea/Cache/Manager.php +++ b/lib/Alchemy/Phrasea/Cache/Manager.php @@ -79,7 +79,11 @@ class Manager $cache = $this->factory->create('array', array()); } - $cache->setNamespace(md5(gethostname().'-'.__DIR__)); + if (isset($options['namespace']) && is_string($options['namespace'])) { + $cache->setNamespace($options['namespace']); + } else { + $cache->setNamespace(md5(gethostname().'-'.__DIR__)); + } $this->drivers[$label] = $cache;