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


PHP LoaderInterface::load方法代码示例

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


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

示例1: getMetadataFor

 /**
  * @param string $class
  * @return Metadata
  */
 public function getMetadataFor($class)
 {
     if (!array_key_exists($class, $this->metadata)) {
         $this->metadata[$class] = $this->loader->load($class);
     }
     return $this->metadata[$class];
 }
开发者ID:tystr,项目名称:redis-orm,代码行数:11,代码来源:MetadataRegistry.php

示例2: registerContainerConfiguration

 /**
  * Loads the container configuration.
  *
  * @param LoaderInterface $loader A LoaderInterface instance
  *
  * @api
  */
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     if (null != $this->config) {
         $loader->load($this->config);
     }
     $loader->load(__DIR__ . '/config/default.yml');
 }
开发者ID:scaytrase,项目名称:symfony-sms-interface,代码行数:14,代码来源:KernelForTest.php

示例3: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load($this->config);
     if (PHP_VERSION_ID > 50400) {
         $loader->load(__DIR__ . '/config/traits.yml');
     }
 }
开发者ID:boast,项目名称:JMSDiExtraBundle,代码行数:7,代码来源:AppKernel.php

示例4: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if (file_exists(__DIR__ . '/config/parameters.yml')) {
         $loader->load(__DIR__ . '/config/parameters.yml');
     }
 }
开发者ID:netconstructor,项目名称:GoogleBundle,代码行数:7,代码来源:TestKernel.php

示例5: onKernelRequest

 public function onKernelRequest(GetResponseEvent $event)
 {
     if (null !== $this->loader) {
         // carrega os annotations para criar as rotas dos rests
         $this->loader->load('');
     }
 }
开发者ID:brodaproject,项目名称:broda,代码行数:7,代码来源:RestResponseListener.php

示例6: testLoad

 public function testLoad()
 {
     $this->yamlParser->parse(file_get_contents(__DIR__ . '/../Resources/Yaml/routes.yml'))->willReturn(['user' => ['channel' => 'notification/user/{username}', 'handler' => ['callback' => ['Gos\\Bundle\\PubSubRouterBundle\\Tests\\Model', 'setPushers'], 'args' => ['gos_redis', 'gos_websocket']], 'requirements' => ['username' => ['pattern' => '[a-zA-Z0-9]+', 'wildcard' => true]]], 'application' => ['channel' => 'notification/application/{applicationName}', 'handler' => ['callback' => ['Gos\\Bundle\\PubSubRouterBundle\\Tests\\Model', 'setPushers'], 'args' => ['gos_redis', 'gos_websocket']], 'requirements' => ['applicationName' => ['pattern' => '[a-zA-Z0-9]+', 'wildcard' => true]]]]);
     $this->injectYamlParser();
     $routeCollection = $this->loader->load('@Resource/routes.yml');
     $this->assertEquals(['user' => new Route('notification/user/{username}', ['Gos\\Bundle\\PubSubRouterBundle\\Tests\\Model', 'setPushers'], ['gos_redis', 'gos_websocket'], ['username' => ['pattern' => '[a-zA-Z0-9]+', 'wildcard' => true]]), 'application' => new Route('notification/application/{applicationName}', ['Gos\\Bundle\\PubSubRouterBundle\\Tests\\Model', 'setPushers'], ['gos_redis', 'gos_websocket'], ['applicationName' => ['pattern' => '[a-zA-Z0-9]+', 'wildcard' => true]])], $this->readProperty($routeCollection, 'routes'));
 }
开发者ID:bretanac93,项目名称:event,代码行数:7,代码来源:YamlFileLoaderTest.php

示例7: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_plugin.yml');
     foreach ($this->pluginAdapter->getConfigurationFiles() as $file) {
         $loader->load($file);
     }
 }
开发者ID:orourkedd,项目名称:symfony-plugin,代码行数:7,代码来源:AppKernel.php

示例8: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     $loader->load(__DIR__ . '/config/security.yml');
     $loader->load(__DIR__ . '/config/roles.yml');
     $loader->load(__DIR__ . '/config/resources.yml');
 }
开发者ID:Onneil,项目名称:dedipanel,代码行数:7,代码来源:AppKernel.php

示例9: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load($this->getRootDir() . '/config/config.yml');
     if ($this->isDebug()) {
         $loader->load($this->getRootDir() . '/config/config_dbg.yml');
     }
 }
开发者ID:adriensamson,项目名称:symfony-tiny-edition,代码行数:7,代码来源:AppKernel.php

示例10: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(SuluTestBundle::getConfigDir() . '/config.php');
     if (class_exists('Sulu\\Bundle\\SearchBundle\\SuluSearchBundle')) {
         $loader->load(__DIR__ . '/config/search.yml');
     }
 }
开发者ID:kriswillis,项目名称:sulu,代码行数:7,代码来源:AppKernel.php

示例11: build

 public function build()
 {
     $finder = new Finder();
     $finder->in($this->path)->files()->name('*.xml')->sortByName();
     // Iterate over config files, and add a portal object for each config to the collection
     $collection = new WebspaceCollection();
     // reset arrays
     $this->webspaces = [];
     $this->portals = [];
     $this->portalInformations = [];
     foreach ($finder as $file) {
         // add file resource for cache invalidation
         $collection->addResource(new FileResource($file->getRealPath()));
         /** @var Webspace $webspace */
         $webspace = $this->loader->load($file->getRealPath());
         $this->webspaces[] = $webspace;
         $this->buildPortals($webspace);
     }
     $environments = array_keys($this->portalInformations);
     foreach ($environments as $environment) {
         // sort all portal informations by length
         uksort($this->portalInformations[$environment], function ($a, $b) {
             return strlen($a) < strlen($b);
         });
     }
     $collection->setWebspaces($this->webspaces);
     $collection->setPortals($this->portals);
     $collection->setPortalInformations($this->portalInformations);
     return $collection;
 }
开发者ID:sulu,项目名称:sulu,代码行数:30,代码来源:WebspaceCollectionBuilder.php

示例12: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if (null !== $this->devConfig) {
         $loader->load($this->devConfig);
     }
 }
开发者ID:neilferreira,项目名称:symfony-standard,代码行数:7,代码来源:AppKernel.php

示例13: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/' . $this->environment . '.yml');
     if (class_exists('Dunglas\\ApiBundle\\DunglasApiBundle')) {
         $loader->load(__DIR__ . '/config/dunglas_api.yml');
     }
 }
开发者ID:ABD-dev,项目名称:NelmioApiDocBundle,代码行数:7,代码来源:AppKernel.php

示例14: registerContainerConfiguration

 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     if (is_file($file = __DIR__ . '/config/config_' . $this->getEnvironment() . '_local.yml')) {
         $loader->load($file);
     }
 }
开发者ID:knplabs,项目名称:rad-edition,代码行数:7,代码来源:AppKernel.php

示例15: load

 /**
  * {@inheritdoc}
  */
 public function load($resource, $type = null)
 {
     if (true === $this->isLoaded) {
         throw new \RuntimeException('Do not add the "modera_routing" loader twice');
     }
     $resources = array();
     $items = $this->resourcesProvider->getItems();
     foreach ($items as $index => $resource) {
         if (!is_array($resource)) {
             $resource = array('resource' => $resource);
         }
         $resource = array_merge(array('order' => 0, 'type' => null), $resource);
         $resource['index'] = $index;
         $resources[] = $resource;
     }
     usort($resources, function ($a, $b) {
         if ($a['order'] == $b['order']) {
             return $a['index'] < $b['index'] ? -1 : 1;
         }
         return $a['order'] < $b['order'] ? -1 : 1;
     });
     $collection = new RouteCollection();
     foreach ($resources as $item) {
         $collection->addCollection($this->rootLoader->load($item['resource'], $item['type']));
     }
     $this->isLoaded = true;
     return $collection;
 }
开发者ID:modera,项目名称:foundation,代码行数:31,代码来源:Loader.php


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