Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
34 | protected function execute(InputInterface $input, OutputInterface $output) |
||
35 | { |
||
36 | $start = microtime(true); |
||
37 | |||
38 | if (file_exists($dir = $this->getContainer()->getParameter('kernel.root_dir').'/../web/media/tmp/')) { |
||
39 | $fs = new Filesystem(); |
||
40 | |||
41 | $finder = new Finder(); |
||
42 | $finder->in($dir)->date('< 1 hour ago')->ignoreUnreadableDirs(); |
||
43 | /* @var $file \SplFileInfo */ |
||
44 | foreach ($finder as $file) { |
||
45 | $fs->remove($file->getRealPath()); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | $output->writeln('Time: <info>'.round((microtime(true) - $start) * 1000, 2).'</info> s.'); |
||
50 | } |
||
51 | } |
||
52 |