diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index ff9577a6bc..fed53652df 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -719,20 +719,8 @@ class Application extends SilexApplication // thumbnails path $this['thumbnail.path'] = $dir = $this['root.path'].'/www/thumbnails'; - // cache path for dev env - $this['cache.dev.path'] = $this->share(function() { - $path = sys_get_temp_dir().'/'.md5($this['root.path']); - // ensure path is created - $this['filesystem']->mkdir($path); - - return $path; - }); - // cache path (twig, minify, translations, configuration, doctrine metas serializer metas, profiler etc ...) $this['cache.path'] = $this->share(function() { -// if ($this->getEnvironment() !== Application::ENV_PROD) { -// return $this['cache.dev.path']; -// } $defaultPath = $path = $this['root.path'].'/cache'; if ($this['phraseanet.configuration']->isSetup()) { $path = $this['conf']->get(['main', 'storage', 'cache'], $path); @@ -745,14 +733,6 @@ class Application extends SilexApplication return $path; }); - $this['cache.paths'] = $this->share(function() { - return array( - self::ENV_DEV => $this['cache.path'], - self::ENV_TEST => $this['cache.path'], - self::ENV_PROD => $this['cache.path'] - ); - }); - // log path $this['log.path'] = $this->share(function() { $defaultPath = $path = $this['root.path'].'/logs'; diff --git a/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php b/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php index 8f4098c4ec..2fdf4f6bc4 100644 --- a/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php +++ b/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php @@ -65,25 +65,24 @@ class Uninstaller extends Command } } - foreach ($this->container['cache.paths'] as $path) { - foreach ([ - $path.'/cache_registry.php', - $path.'/cache_registry.yml', - $path.'/serializer', - $path.'/doctrine', - $path.'/twig', - $path.'/translations', - $path.'/minify', - $path.'/profiler', - ] as $resource) { - if (is_dir($resource)) { - $finder = new Finder(); - foreach ($finder->files()->in($resource) as $file) { - $this->container['filesystem']->remove($file); - } - } elseif (is_file($resource)) { - $this->container['filesystem']->remove($resource); + $path = $this->container['cache.path']; + foreach ([ + $path.'/cache_registry.php', + $path.'/cache_registry.yml', + $path.'/serializer', + $path.'/doctrine', + $path.'/twig', + $path.'/translations', + $path.'/minify', + $path.'/profiler', + ] as $resource) { + if (is_dir($resource)) { + $finder = new Finder(); + foreach ($finder->files()->in($resource) as $file) { + $this->container['filesystem']->remove($file); } + } elseif (is_file($resource)) { + $this->container['filesystem']->remove($resource); } } diff --git a/lib/classes/appbox.php b/lib/classes/appbox.php index 7bb3e77755..4ccc70bfc8 100644 --- a/lib/classes/appbox.php +++ b/lib/classes/appbox.php @@ -273,14 +273,13 @@ class appbox extends base $finder = new Finder(); $in = []; - foreach ($app['cache.paths'] as $path) { - $in[] = $path.'/minify/'; - $in[] = $path.'/twig/'; - $in[] = $path.'/translations/'; - $in[] = $path.'/profiler/'; - $in[] = $path.'/doctrine/'; - $in[] = $path.'/serializer/'; - }; + $path = $app['cache.path']; + $in[] = $path.'/minify/'; + $in[] = $path.'/twig/'; + $in[] = $path.'/translations/'; + $in[] = $path.'/profiler/'; + $in[] = $path.'/doctrine/'; + $in[] = $path.'/serializer/'; $finder->in(array_filter($in, function($path) { return is_dir($path); })) diff --git a/lib/classes/module/console/systemClearCache.php b/lib/classes/module/console/systemClearCache.php index 1c49f37c8e..01662d796a 100644 --- a/lib/classes/module/console/systemClearCache.php +++ b/lib/classes/module/console/systemClearCache.php @@ -31,10 +31,7 @@ class module_console_systemClearCache extends Command { $finder = new Finder(); - $in = []; - foreach ($this->container['cache.paths'] as $path) { - $in[] = $path; - }; + $in = $this->container['cache.path']; $finder ->exclude('.git') ->exclude('.svn')