mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Fix CS
This commit is contained in:
@@ -26,20 +26,20 @@ use Symfony\Component\Console\Command\Command;
|
||||
class module_console_systemClearCache extends Command
|
||||
{
|
||||
|
||||
public function __construct($name = null)
|
||||
{
|
||||
parent::__construct($name);
|
||||
public function __construct($name = null)
|
||||
{
|
||||
parent::__construct($name);
|
||||
|
||||
$this->setDescription('Empty cache directories, clear Memcached, Redis if avalaible');
|
||||
$this->setDescription('Empty cache directories, clear Memcached, Redis if avalaible');
|
||||
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$files = $dirs = array();
|
||||
$finder = new Finder();
|
||||
$finder
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$files = $dirs = array();
|
||||
$finder = new Finder();
|
||||
$finder
|
||||
->files()
|
||||
->exclude('.git')
|
||||
->exclude('.svn')
|
||||
@@ -48,15 +48,14 @@ class module_console_systemClearCache extends Command
|
||||
, __DIR__ . '/../../../../tmp/cache_twig/'
|
||||
));
|
||||
|
||||
$count = 1;
|
||||
foreach ($finder as $file)
|
||||
{
|
||||
$files[$file->getPathname()] = $file->getPathname();
|
||||
$count++;
|
||||
}
|
||||
$count = 1;
|
||||
foreach ($finder as $file) {
|
||||
$files[$file->getPathname()] = $file->getPathname();
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$finder = new Finder();
|
||||
$finder
|
||||
$finder = new Finder();
|
||||
$finder
|
||||
->directories()
|
||||
->in(array(
|
||||
__DIR__ . '/../../../../tmp/cache_minify'
|
||||
@@ -65,31 +64,26 @@ class module_console_systemClearCache extends Command
|
||||
->exclude('.git')
|
||||
->exclude('.svn');
|
||||
|
||||
foreach ($finder as $file)
|
||||
{
|
||||
$dirs[$file->getPathname()] = $file->getPathname();
|
||||
printf('%4d) %s' . PHP_EOL, $count, $file->getPathname());
|
||||
$count++;
|
||||
foreach ($finder as $file) {
|
||||
$dirs[$file->getPathname()] = $file->getPathname();
|
||||
printf('%4d) %s' . PHP_EOL, $count, $file->getPathname());
|
||||
$count ++;
|
||||
}
|
||||
|
||||
foreach ($files as $file) {
|
||||
unlink($file);
|
||||
}
|
||||
foreach ($dirs as $dir) {
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
if (setup::is_installed()) {
|
||||
$Core = \bootstrap::getCore();
|
||||
$Core['CacheService']->flushAll();
|
||||
}
|
||||
|
||||
$output->write('Finished !', true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
unlink($file);
|
||||
}
|
||||
foreach ($dirs as $dir)
|
||||
{
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
if(setup::is_installed())
|
||||
{
|
||||
$Core = \bootstrap::getCore();
|
||||
$Core['CacheService']->flushAll();
|
||||
}
|
||||
|
||||
$output->write('Finished !', true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user