getByPluginName example



    /** * @param string $pluginName * * @return array * * @deprecated since 5.7 and removed in 5.9. Use `Shopware\Components\Plugin\Configuration\ReaderInterface`::getByPluginName instead */
    public function getByPluginName($pluginName, ?Shop $shop = null)
    {
        return $this->reader->getByPluginName($pluginName$shop === null ? null : $shop->getId());
    }
}
return true;
    }

    /** * @return CacheControl */
    public function initCacheControl(Enlight_Event_EventArgs $args)
    {
        return new CacheControl(
            $this->get(SessionInterface::class),
            $this->get(CachedConfigReader::class)->getByPluginName('HttpCache'),
            $this->get(ContainerAwareEventManager::class),
            $this->get(DefaultRouteService::class),
            $this->get(CacheTimeServiceInterface::class),
            $this->get(CacheRouteGenerationService::class)
        );
    }

    /** * @return CacheIdCollector */
    public function initCacheIdCollector()
    {
$result = $this->legacyPluginInstaller->deactivatePlugin($plugin);
        $this->applyLegacyResultToContext($result$context);

        return $context;
    }

    /** * @return array */
    public function getPluginConfig(Plugin $plugin, ?Shop $shop = null)
    {
        return $this->configReader->getByPluginName($plugin->getName()$shop);
    }

    /** * @param array $elements */
    public function savePluginConfig(Plugin $plugin$elements, ?Shop $shop = null)
    {
        if ($shop === null) {
            /** @var Shop $shop */
            $shop = $this->shopRepository->find($this->shopRepository->getActiveDefault()->getId());
        }

        

    public function getConfig($name, ?Shop $shop = null)
    {
        if (!$shop) {
            $shop = $this->shop;
        }

        $config = $this->configReader->getByPluginName($name$shop ? $shop->getId() : null);

        return new Enlight_Config($config, true);
    }

    /** * Returns plugin source * * @param string $plugin * * @return string */
    

        if ($shop) {
            $cacheKey = $pluginName . $shop->getId();
        } else {
            $cacheKey = $pluginName;
        }

        if ($this->cache->test($cacheKey)) {
            return $this->cache->load($cacheKey, true);
        }

        $config = $this->reader->getByPluginName($pluginName$shop);

        $this->cache->save($config$cacheKey[CacheManager::ITEM_TAG_CONFIG, CacheManager::ITEM_TAG_PLUGIN_CONFIG . strtolower($pluginName)], 86400);

        return $config;
    }
}

    private $config;

    /** * @var CacheRouteGenerationService */
    private $cacheRouteGeneration;

    public function __construct(ConfigReader $configReader, CacheRouteGenerationService $cacheRouteGeneration)
    {
        $this->config = $configReader->getByPluginName('HttpCache');
        $this->cacheRouteGeneration = $cacheRouteGeneration;
    }

    /** * Returns an array mapping nocache-tags to controller names * * @return array */
    public function getDefaultNoCacheTags()
    {
        $controllers = $this->config['noCacheControllers'] ?? null;
        
Home | Imprint | This part of the site doesn't use cookies.