/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $dir = $input->getOption('dir'); $tag = $input->getOption('tag'); $cache = Cache::createInstance(); if (empty($dir) && empty($tag)) { Application::getInstance()->getManagedCache()->cleanAll(); $cache->cleanDir(); $cache->cleanDir(false, 'stack_cache'); StaticHtmlCache::getInstance()->deleteAll(); if (Cache::clearCache(true)) { $output->writeln('<info>All Bitrix cache was deleted</info>'); } else { $output->writeln('<error>Error deleting Bitrix cache</error>'); } } if ($dir) { $cache->cleanDir($dir); $output->writeln('<info>Bitrix cache by "/' . BX_ROOT . '/cache/' . $dir . '" dir was deleted</info>'); } if ($tag) { Application::getInstance()->getTaggedCache()->clearByTag($tag); $output->writeln('<info>Bitrix cache by tag "' . $tag . '" was deleted</info>'); } }