Aimeos\ShopBundle\Command\CacheCommand::execute PHP Method

execute() protected method

Executes the job controllers.
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface Input object
$output Symfony\Component\Console\Output\OutputInterface Output object
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $context = $this->getContainer()->get('aimeos_context')->get(false, 'command');
        $context->setEditor('aimeos:cache');
        $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
        foreach ($this->getSiteItems($context, $input) as $siteItem) {
            $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
            $lcontext = clone $context;
            $lcontext->setLocale($localeItem);
            $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext);
            $lcontext->setCache($cache);
            $output->writeln(sprintf('Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode()));
            \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush();
        }
    }