cache = $cache; $this->events = $events; $this->paths = $paths; parent::__construct(); } /** * {@inheritdoc} */ protected function configure() { $this ->setName('cache:clear') ->setDescription('Remove all temporary and generated files'); } /** * {@inheritdoc} */ protected function fire() { $this->info('Clearing the cache...'); $this->cache->flush(); $storagePath = $this->paths->storage; array_map('unlink', glob($storagePath.'/formatter/*')); array_map('unlink', glob($storagePath.'/locale/*')); array_map('unlink', glob($storagePath.'/views/*')); $this->events->dispatch(new ClearingCache); } }