N98\Magento\Command\Cache\CleanCommand::execute PHP 메소드

execute() 보호된 메소드

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
리턴 integer | void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $noReinitOption = $input->getOption('no-reinit');
        if (!$noReinitOption) {
            $this->banUseCache();
        }
        $this->detectMagento($output, true);
        if (!$this->initMagento()) {
            return;
        }
        \Mage::app()->loadAreaPart('adminhtml', 'events');
        $allTypes = \Mage::app()->getCacheInstance()->getTypes();
        $typesToClean = $input->getArgument('type');
        $this->validateCacheCodes($typesToClean);
        $typeKeys = array_keys($allTypes);
        foreach ($typeKeys as $type) {
            if (count($typesToClean) == 0 || in_array($type, $typesToClean)) {
                \Mage::app()->getCacheInstance()->cleanType($type);
                \Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => $type));
                $output->writeln('<info>Cache <comment>' . $type . '</comment> cleaned</info>');
            }
        }
        if (!$noReinitOption) {
            $this->reinitCache();
        }
    }