N98\Magento\Command\Cache\Dir\FlushCommand::execute PHP Method

execute() protected method

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
return integer | void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $this->detectMagento($output, true);
        if (!$this->initMagento()) {
            return;
        }
        $workingDirectory = getcwd();
        $magentoRootFolder = $this->getApplication()->getMagentoRootFolder();
        $cacheDir = $magentoRootFolder . '/var/cache';
        $output->writeln(sprintf('<info>Flushing cache directory <comment>%s</comment></info>', $cacheDir));
        $this->verbose(sprintf('<debug>root-dir: <comment>%s</comment>', $magentoRootFolder));
        $this->verbose(sprintf('<debug>cwd: <comment>%s</comment>', $workingDirectory));
        $this->emptyDirectory($cacheDir);
        $output->writeln('Cache directory flushed');
    }