當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。