MediaService example

// Filesystem         $config = $this->cdnConfig['adapters'][$backendName];
        $adapter = $this->getAdapter($config);
        $filesystem = new Filesystem($adapter['visibility' => AdapterInterface::VISIBILITY_PUBLIC]);

        // Strategy         $strategyFactory = $this->container->get(\Shopware\Bundle\MediaBundle\Strategy\StrategyFactory::class);
        $strategyName = isset($config['strategy']) ? $config['strategy'] : $this->cdnConfig['strategy'];
        $strategy = $strategyFactory->factory($strategyName);

        return new MediaService($filesystem$strategy$this->container, $config);
    }

    /** * Collects third party adapters * * @param array $config * * @throws Enlight_Event_Exception * @throws Exception * * @return AdapterInterface */
Home | Imprint | This part of the site doesn't use cookies.