clearConfigCache example


    protected function clearCache($cache)
    {
        $capabilities = $this->cache->getBackend()->getCapabilities();

        if ($cache === 'all') {
            $this->cache->clean();

            $this->cacheManager->clearHttpCache();
            $this->cacheManager->clearConfigCache();
            $this->cacheManager->clearTemplateCache();
            $this->cacheManager->clearProxyCache();
            $this->cacheManager->clearSearchCache();
            $this->cacheManager->clearOpCache();

            return;
        }

        switch ($cache) {
            case 'http':
                $this->cacheManager->clearHttpCache();
                
if ($eventArgs->getName() === PluginEvent::POST_INSTALL) {
            $installedPlugins[] = $eventArgs->getPlugin()->getName();
        } else {
            $index = array_search($eventArgs->getPlugin()->getName()$installedPlugins, true);

            if ($index) {
                unset($installedPlugins[$index]);
            }
        }

        $this->synchronizerService->sync($installedPlugins);
        $this->cacheManager->clearConfigCache();
        $this->cacheManager->clearProxyCache();
    }
}
$conn->update(
                's_core_config_values',
                $data,
                ['id' => $valueid]
            );
        } else {
            $conn->insert('s_core_config_values', $data);
        }

        /** @var \Shopware\Components\CacheManager $cacheManager */
        $cacheManager = $this->container->get(\Shopware\Components\CacheManager::class);
        $cacheManager->clearConfigCache();

        $output->writeln('<info>First Run Wizard disabled</info>');

        return 0;
    }
}
$conn->update(
                's_core_config_values',
                $data,
                ['id' => $valueid]
            );
        } else {
            $conn->insert('s_core_config_values', $data);
        }

        /** @var \Shopware\Components\CacheManager $cacheManager */
        $cacheManager = $this->container->get(\Shopware\Components\CacheManager::class);
        $cacheManager->clearConfigCache();

        $output->writeln('<info>First Run Wizard enabled</info>');

        return 0;
    }
}
/** * Clear cache by its tag of CacheManager::CACHE_TAG_* * * @param string $tag * * @return bool */
    public function clearByTag($tag)
    {
        switch ($tag) {
            case self::CACHE_TAG_CONFIG:
                $this->clearConfigCache();
                break;
            case self::CACHE_TAG_SEARCH:
                $this->clearSearchCache();
                break;
            case self::CACHE_TAG_ROUTER:
                $this->clearRewriteCache();
                break;
            case self::CACHE_TAG_TEMPLATE:
                $this->clearTemplateCache();
                break;
            case self::CACHE_TAG_THEME:
            
class Shopware_Controllers_Backend_UpdateWizard extends Shopware_Controllers_Backend_ExtJs
{
    public function indexAction()
    {
        /** @var Connection $connection */
        $connection = $this->get(\Doctrine\DBAL\Connection::class);
        $sql = "INSERT IGNORE INTO `s_core_config_elements` (`id`, `form_id`, `name`, `value`, `label`, `description`, `type`, `required`, `position`, `scope`) VALUES (NULL, '0', 'updateWizardStarted', 'b:1;', '', '', 'checkbox', '0', '0', '1');";
        $connection->executeUpdate($sql);

        Shopware()->Container()->get(\Shopware\Components\CacheManager::class)->clearConfigCache();
    }

    public function updateAction()
    {
        $pluginCheck = new \ShopwarePlugins\SwagUpdate\Components\PluginCheck($this->container);

        /** @var PluginLicenceService $licenceService */
        $licenceService = $this->get(\Shopware\Bundle\PluginInstallerBundle\Service\PluginLicenceService::class);

        /** @var AccountManagerService $accountService */
        $accountService = $this->get(\Shopware\Bundle\PluginInstallerBundle\Service\AccountManagerService::class);

        
/** * Clear cache action */
    public function clearDirectAction()
    {
        $cache = $this->Request()->getQuery('cache');
        switch ($cache) {
            case 'Config':
                $this->cacheManager->clearHttpCache();
                $this->cacheManager->clearTemplateCache();
                $this->cacheManager->clearConfigCache();
                $this->cacheManager->clearSearchCache();
                $this->cacheManager->clearProxyCache();
                break;
            default:
                break;
        }
    }

    /** * {@inheritdoc} */
    

                'fields' => $data['fields'],
            ],
        ];

        return $this->typeBuilder->createType($data['internalName']$data);
    }

    private function clearCacheAndSync(): void
    {
        $this->synchronizerService->sync(true);
        $this->cacheManager->clearConfigCache();
        $this->cacheManager->clearProxyCache();
    }

    private function createUrls(Type $type): void
    {
        $shops = $this->getModelManager()->getRepository(Shop::class)->getActiveShopsFixed();
        $seoIndexer = $this->get('seoindex');

        $rewriteTable = $this->get('modules')->RewriteTable();

        foreach ($shops as $shop) {
            
'success' => true,
            'data' => $values,
        ]);
    }

    public function saveConfigAction(bool $mailLogActive, array $mailLogActiveFilters, int $mailLogCleanupMaximumAgeInDays): void
    {
        $this->writer->save(self::CONFIG_KEY_MAILLOG_ACTIVE, $mailLogActive);
        $this->writer->save(self::CONFIG_KEY_MAILLOG_ACTIVE_FILTERS, $mailLogActiveFilters);
        $this->writer->save(self::CONFIG_KEY_MAILLOG_MAX_AGE, $mailLogCleanupMaximumAgeInDays);

        $this->cacheManager->clearConfigCache();

        $this->View()->assign([
            'success' => true,
            'data' => null,
        ]);
    }

    public function getFiltersAction(): void
    {
        $filters = [];
        $snippets = $this->snippetManager->getNamespace(self::SNIPPET_NAMESPACE);

        
Home | Imprint | This part of the site doesn't use cookies.