createFallbackMediaUrl example

public function __construct(FilesystemInterface $filesystem, StrategyInterface $strategy, ContainerInterface $container, array $config)
    {
        $this->filesystem = $filesystem;
        $this->container = $container;
        $this->strategy = $strategy;
        $this->config = $config;

        if (!isset($config['mediaUrl'])) {
            throw new Exception(sprintf('Please provide a "mediaUrl" in your %s adapter.', $config['type']));
        }

        $mediaUrl = $config['mediaUrl'] ?: $this->createFallbackMediaUrl();
        $this->mediaUrl = rtrim($mediaUrl, '/');
    }

    /** * {@inheritdoc} */
    public function read($path)
    {
        $this->migrateFileLive($path);
        $path = $this->strategy->encode($path);

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