mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Remove useless cache.paths services, use cache.path instead
This commit is contained in:
@@ -719,20 +719,8 @@ class Application extends SilexApplication
|
|||||||
// thumbnails path
|
// thumbnails path
|
||||||
$this['thumbnail.path'] = $dir = $this['root.path'].'/www/thumbnails';
|
$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 ...)
|
// cache path (twig, minify, translations, configuration, doctrine metas serializer metas, profiler etc ...)
|
||||||
$this['cache.path'] = $this->share(function() {
|
$this['cache.path'] = $this->share(function() {
|
||||||
// if ($this->getEnvironment() !== Application::ENV_PROD) {
|
|
||||||
// return $this['cache.dev.path'];
|
|
||||||
// }
|
|
||||||
$defaultPath = $path = $this['root.path'].'/cache';
|
$defaultPath = $path = $this['root.path'].'/cache';
|
||||||
if ($this['phraseanet.configuration']->isSetup()) {
|
if ($this['phraseanet.configuration']->isSetup()) {
|
||||||
$path = $this['conf']->get(['main', 'storage', 'cache'], $path);
|
$path = $this['conf']->get(['main', 'storage', 'cache'], $path);
|
||||||
@@ -745,14 +733,6 @@ class Application extends SilexApplication
|
|||||||
return $path;
|
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
|
// log path
|
||||||
$this['log.path'] = $this->share(function() {
|
$this['log.path'] = $this->share(function() {
|
||||||
$defaultPath = $path = $this['root.path'].'/logs';
|
$defaultPath = $path = $this['root.path'].'/logs';
|
||||||
|
@@ -65,7 +65,7 @@ class Uninstaller extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->container['cache.paths'] as $path) {
|
$path = $this->container['cache.path'];
|
||||||
foreach ([
|
foreach ([
|
||||||
$path.'/cache_registry.php',
|
$path.'/cache_registry.php',
|
||||||
$path.'/cache_registry.yml',
|
$path.'/cache_registry.yml',
|
||||||
@@ -85,7 +85,6 @@ class Uninstaller extends Command
|
|||||||
$this->container['filesystem']->remove($resource);
|
$this->container['filesystem']->remove($resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -273,14 +273,13 @@ class appbox extends base
|
|||||||
|
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$in = [];
|
$in = [];
|
||||||
foreach ($app['cache.paths'] as $path) {
|
$path = $app['cache.path'];
|
||||||
$in[] = $path.'/minify/';
|
$in[] = $path.'/minify/';
|
||||||
$in[] = $path.'/twig/';
|
$in[] = $path.'/twig/';
|
||||||
$in[] = $path.'/translations/';
|
$in[] = $path.'/translations/';
|
||||||
$in[] = $path.'/profiler/';
|
$in[] = $path.'/profiler/';
|
||||||
$in[] = $path.'/doctrine/';
|
$in[] = $path.'/doctrine/';
|
||||||
$in[] = $path.'/serializer/';
|
$in[] = $path.'/serializer/';
|
||||||
};
|
|
||||||
$finder->in(array_filter($in, function($path) {
|
$finder->in(array_filter($in, function($path) {
|
||||||
return is_dir($path);
|
return is_dir($path);
|
||||||
}))
|
}))
|
||||||
|
@@ -31,10 +31,7 @@ class module_console_systemClearCache extends Command
|
|||||||
{
|
{
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
|
|
||||||
$in = [];
|
$in = $this->container['cache.path'];
|
||||||
foreach ($this->container['cache.paths'] as $path) {
|
|
||||||
$in[] = $path;
|
|
||||||
};
|
|
||||||
$finder
|
$finder
|
||||||
->exclude('.git')
|
->exclude('.git')
|
||||||
->exclude('.svn')
|
->exclude('.svn')
|
||||||
|
Reference in New Issue
Block a user