当前位置: 首页>>代码示例>>PHP>>正文


PHP YamlFileLoader::load方法代码示例

本文整理汇总了PHP中Symfony\Component\DependencyInjection\Loader\YamlFileLoader::load方法的典型用法代码示例。如果您正苦于以下问题:PHP YamlFileLoader::load方法的具体用法?PHP YamlFileLoader::load怎么用?PHP YamlFileLoader::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\DependencyInjection\Loader\YamlFileLoader的用法示例。


在下文中一共展示了YamlFileLoader::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = $this->getConfiguration(array(), $container);
     $config = $this->processConfiguration($configuration, $configs);
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/'));
     $loader->load('console.yml');
     $loader->load('version_strategy.yml');
     $loader->load('manifest.yml');
     if ($config['livereload']['enabled']) {
         $loader->load('livereload.yml');
         $container->getDefinition($this->id('livereload.listener'))->addArgument($config['livereload']['url']);
     }
     $helper = Util::hasAssetComponent() ? new AssetExtensionHelper($this->getAlias(), $container, $loader) : new TemplatingExtensionHelper($this->getAlias(), $container, $loader);
     if ($config['override_default_package']) {
         $loader->load('fallback.yml');
         $defaultPackage = $helper->createPackage('default', array('prefix' => $config['prefix'], 'manifest' => $config['manifest']));
         $defaultPackageId = $helper->getPackageId('default');
         $container->setDefinition($defaultPackageId, $defaultPackage);
         $fallbackPackage = $helper->createFallbackPackage($config['fallback_patterns'], new Reference($defaultPackageId));
         $container->setDefinition($this->id('package.fallback'), $fallbackPackage);
     }
     foreach ($config['packages'] as $name => $packageConfig) {
         $package = $helper->createPackage($name, $packageConfig)->addTag($helper->getPackageTag(), array('alias' => $name));
         $container->setDefinition($helper->getPackageId($name), $package);
     }
 }
开发者ID:regularjack,项目名称:frontend-bundle,代码行数:29,代码来源:RjFrontendExtension.php

示例2: load

 /**
  * {@inheritDoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.yml');
     $loader->load('form_type.yml');
     $this->addClassesToCompile(['Oro\\Bundle\\DataAuditBundle\\EventListener\\KernelListener']);
 }
开发者ID:ramunasd,项目名称:platform,代码行数:10,代码来源:OroDataAuditExtension.php

示例3: loadSerializerConfig

 /**
  * Load serializer related configuration
  *
  * @param array            $configs
  * @param ContainerBuilder $container
  */
 protected function loadSerializerConfig(array $configs, ContainerBuilder $container)
 {
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/serializer'));
     $loader->load('flat.yml');
     $loader->load('serializer.yml');
     $loader->load('structured.yml');
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:13,代码来源:PimVersioningExtension.php

示例4: load

 /**
  * {@inheritdoc}
  */
 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(sprintf('services.%s.yml', $config['db_driver']));
     $container->setParameter($this->getAlias() . '.db_driver', $config['db_driver']);
     $container->setParameter($this->getAlias() . '.model_manager_name', $config['model_manager_name']);
     $container->setParameter($this->getAlias() . '.cronjob_class', $config['cronjob_class']);
     $container->setParameter($this->getAlias() . '.cronjob_console', $config['cronjob_console']);
     $container->setParameter($this->getAlias() . '.logs_path', $config['logs_path']);
     if ('orm' === $config['db_driver']) {
         $managerService = $this->getAlias() . '.entity_manager';
         $doctrineService = 'doctrine';
     } else {
         $managerService = '';
         $doctrineService = '';
     }
     $definition = $container->getDefinition($managerService);
     if (method_exists($definition, 'setFactory')) {
         $definition->setFactory(array(new Reference($doctrineService), 'getManager'));
     } else {
         $definition->setFactoryService($doctrineService);
         $definition->setFactoryMethod('getManager');
     }
     $container->setAlias($this->getAlias() . '.manager', $config['crontab_manager']);
     $definition = $container->getDefinition($config['crontab_manager']);
     $definition->addMethodCall('registryConfigCronjobs', array($config['jobs']));
     $loader->load('services.yml');
 }
开发者ID:agentsib,项目名称:crontab-bundle,代码行数:33,代码来源:AgentSIBCrontabExtension.php

示例5: load

 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('fixture_loader.yml');
     $loader->load('services.yml');
     $this->addInstallerDataFiles($container);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:10,代码来源:PimInstallerExtension.php

示例6: load

 /**
  * {@inheritDoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $yamlloader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $yamlloader->load("form_extensions.yml");
     if (isset($config['form'])) {
         foreach ($config['form'] as $key => $value) {
             if (is_array($value)) {
                 foreach ($config['form'][$key] as $subkey => $subvalue) {
                     $container->setParameter('mopa_bootstrap.form.' . $key . '.' . $subkey, $subvalue);
                 }
             } else {
                 $container->setParameter('mopa_bootstrap.form.' . $key, $value);
             }
         }
     }
     if (isset($config['navbar'])) {
         $yamlloader->load("navbar_extension.yml");
         foreach ($config['navbar'] as $key => $value) {
             $container->setParameter('mopa_bootstrap.navbar.' . $key, $value);
         }
     }
     // set container parameters for Initializr base template
     if (isset($config['initializr'])) {
         // load Twig extension mapping config variables to Twig Globals
         $yamlloader->load('twig_extensions.yml');
         $container->setParameter('mopa_bootstrap.initializr.meta', $config['initializr']['meta']);
         $container->setParameter('mopa_bootstrap.initializr.google', $config['initializr']['google']);
         $container->setParameter('mopa_bootstrap.initializr.dns_prefetch', $config['initializr']['dns_prefetch']);
         // TODO: think about setting this default as kernel debug,
         // what about PROD env which does not need diagnostic mode and test
         $container->setParameter('mopa_bootstrap.initializr.diagnostic_mode', $config['initializr']['diagnostic_mode']);
     }
 }
开发者ID:ramsondon,项目名称:MopaBootstrapBundle,代码行数:38,代码来源:MopaBootstrapExtension.php

示例7: load

 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = $this->getConfiguration($configs, $container);
     $config = $this->processConfiguration($configuration, $configs);
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.yml');
     $loader->load('slots.yml');
     $loader->load('default_settings.yml');
     if (isset($config['api_endpoint'])) {
         $container->setParameter('ez_recommendation.api_endpoint', $config['api_endpoint']);
     }
     if (isset($config['recommender']['api_endpoint'])) {
         $container->setParameter('ez_recommendation.recommender.api_endpoint', $config['recommender']['api_endpoint']);
     }
     if (isset($config['recommender']['consume_timeout'])) {
         $container->setParameter('ez_recommendation.recommender.consume_timeout', $config['recommender']['consume_timeout']);
     }
     if (isset($config['tracking']['script_url'])) {
         $container->setParameter('ez_recommendation.tracking.script_url', $config['tracking']['script_url']);
     }
     if (isset($config['tracking']['api_endpoint'])) {
         $container->setParameter('ez_recommendation.tracking.api_endpoint', $config['tracking']['api_endpoint']);
     }
     $processor = new ConfigurationProcessor($container, 'ez_recommendation');
     $processor->mapConfig($config, new ConfigurationMapper());
 }
开发者ID:krzyraj,项目名称:EzSystemsRecommendationBundle,代码行数:29,代码来源:EzSystemsRecommendationExtension.php

示例8: load

 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('form_types.yml');
     $loader->load('utility.yml');
     $loader->load('filters.yml');
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:10,代码来源:PimFilterExtension.php

示例9: load

 /**
  * Loads a specific configuration.
  *
  * @param array            $configs   An array of configuration values
  * @param ContainerBuilder $container A ContainerBuilder instance
  *
  * @throws \InvalidArgumentException When provided tag is not defined in this extension
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $config = $this->processConfiguration(new Configuration(), $configs);
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('api.yml');
     if ($container->hasParameter('kernel.environment') && $container->getParameter('kernel.environment') === 'test') {
         $loader->load('test.yml');
     }
     $container->setParameter('bankiru_api.logger_id', $config['logger']['id']);
     $container->setParameter('bankiru_api.profiler_enabled', $config['profiling']);
     $configuration = $container->getDefinition('bankiru_api.configuration');
     if ($config['cache']['enabled']) {
         if (null === $config['cache']['service']) {
             throw new \LogicException('You should specify PSR-6 cache service in order to enable caching');
         }
         $configuration->addMethodCall('setApiCache', [new Reference($config['cache']['service'])]);
         if ($config['cache']['logger'] !== null) {
             $configuration->addMethodCall('setApiCacheLogger', [new Reference($config['cache']['logger'])]);
         }
     }
     foreach ($config['cache']['configuration'] as $class => $options) {
         assert(array_key_exists('enabled', $options));
         assert(array_key_exists('ttl', $options));
         $configuration->addMethodCall('setCacheConfiguration', [$class, $options]);
     }
 }
开发者ID:bankiru,项目名称:doctrine-api-bundle,代码行数:34,代码来源:ApiExtension.php

示例10: load

 /**
  * load
  *
  * @see Extension
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services/pomm.yml');
     $loader->load('services/profiler.yml');
     $config = $this->configure($configs, $container);
 }
开发者ID:mahanhaz,项目名称:pomm-bundle,代码行数:12,代码来源:PommExtension.php

示例11: load

 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
     $loader->load('readers.yml');
     $loader->load('processors.yml');
     $loader->load('writers.yml');
 }
开发者ID:nidup,项目名称:pim-docs,代码行数:7,代码来源:AcmeSpecificConnectorExtension.php

示例12: load

 /** {@inheritdoc} */
 public function load(array $config, ContainerBuilder $container)
 {
     // Load configuration
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('webpack.yml');
     // Enable the request listener if we're running in dev.
     if ($container->getParameter('kernel.environment') === 'dev') {
         $loader->load('dev.yml');
     }
     // Retrieve all configuration entities
     $builder_definition = $container->getDefinition('hostnet_webpack.bridge.config_generator');
     $config_extension_ids = array_keys($container->findTaggedServiceIds('hostnet_webpack.config_extension'));
     $config_definitions = [];
     foreach ($config_extension_ids as $id) {
         $config_definitions[$id] = $container->getDefinition($id);
     }
     $config = $this->processConfiguration($this->getConfiguration($config, $container), $config);
     $container->addResource(new FileResource((new \ReflectionClass(Configuration::class))->getFileName()));
     // Select the correct node binary for the platform we're currently running on.
     $config['node']['binary'] = $config['node']['binary'][$this->getPlatformKey()];
     $config['node']['node_modules_path'] = !empty($config['node']['node_modules_path']) ? $config['node']['node_modules_path'] : getenv('NODE_PATH');
     // Parse application config into the config generator
     foreach ($config_definitions as $id => $definition) {
         /* @var $definition Definition */
         $builder_definition->addMethodCall('addExtension', [new Reference($id)]);
         $definition->addArgument($config);
     }
     // Pass the configuration to a container parameter for the CompilerPass and profiler to read.
     $container->setParameter('hostnet_webpack_config', $config);
 }
开发者ID:eljam,项目名称:webpack-bundle,代码行数:31,代码来源:WebpackExtension.php

示例13: load

 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('twig_extensions.yml');
     $loader->load('listeners.yml');
     $loader->load('custom_letters.yml');
 }
开发者ID:InnovaLangues,项目名称:MagicWord,代码行数:10,代码来源:MagicWordExtension.php

示例14: load

 /**
  * {@inheritDoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('factories.yml');
     $loader->load('repositories.yml');
     $loader->load('updaters.yml');
 }
开发者ID:umpirsky,项目名称:pim-community-dev,代码行数:10,代码来源:PimClassificationExtension.php

示例15: load

 public function load(array $configs, ContainerBuilder $container)
 {
     $locator = new FileLocator(__DIR__ . '/../Resources/config');
     $loader = new YamlFileLoader($container, $locator);
     $loader->load('services.yml');
     $loader->load('parameters.yml');
 }
开发者ID:pitrackster,项目名称:ExoBundle,代码行数:7,代码来源:UJMExoExtension.php


注:本文中的Symfony\Component\DependencyInjection\Loader\YamlFileLoader::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。