protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectMagento($output, true);
$noReinitOption = $input->getOption('no-reinit');
if (!$noReinitOption) {
$this->banUseCache();
}
if (!$this->initMagento()) {
return;
}
\Mage::app()->loadAreaPart('adminhtml', 'events');
\Mage::dispatchEvent('adminhtml_cache_flush_all', array('output' => $output));
$result = \Mage::app()->getCacheInstance()->flush();
if ($result) {
$output->writeln('<info>Cache cleared</info>');
} else {
$output->writeln('<error>Failed to clear Cache</error>');
}
if (!$noReinitOption) {
$this->reinitCache();
}
/* Since Magento 1.10 we have an own cache handler for FPC */
if ($this->isEnterpriseFullPageCachePresent()) {
$result = \Enterprise_PageCache_Model_Cache::getCacheInstance()->flush();
if ($result) {
$output->writeln('<info>FPC cleared</info>');
} else {
$output->writeln('<error>Failed to clear FPC</error>');
}
}
}