src/PHPDish/Bundle/MediaBundle/DependencyInjection/PHPDishMediaExtension.php
public function load(array $configs, ContainerBuilder $container)
    {
        //处理配置
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        //加载服务配置
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        //process imagine resolver
        $imagineResolver = $container->findDefinition('phpdish_media.imagine.resolver');
        $imagineResolver->replaceArgument('$webRootDir', $config['imagine_resolver']['web_root']);
        $imagineResolver->replaceArgument('$cachePrefix', $config['imagine_resolver']['cache_prefix']);
        $imagineResolver->replaceArgument('$baseUrl', $config['imagine_resolver']['cdn_host']);

        //process twig extension
        $container->findDefinition('phpdish_media.twig_extension')->replaceArgument(1, $config['imagine_resolver']['cdn_host']);
        // process media mapping
        $this->processMediaMapping($config, $container);

        //process oneup uploader
        $this->processOneupUploader($config, $container);
    }
public function load(array $configs, ContainerBuilder $container)
    {
        //处理配置
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        //加载服务配置
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        //process imagine resolver
        $imagineResolver = $container->findDefinition('phpdish_media.imagine.resolver');
        $imagineResolver->replaceArgument('$webRootDir', $config['imagine_resolver']['web_root']);
        $imagineResolver->replaceArgument('$cachePrefix', $config['imagine_resolver']['cache_prefix']);
        $imagineResolver->replaceArgument('$baseUrl', $config['imagine_resolver']['cdn_host']);

        //process twig extension
        $container->findDefinition('phpdish_media.twig_extension')->replaceArgument(1, $config['imagine_resolver']['cdn_host']);
        // process media mapping
        $this->processMediaMapping($config, $container);

        //process oneup uploader
        $this->processOneupUploader($config, $container);
    }
{@inheritdoc}