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


PHP Container::freeze方法代码示例

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


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

示例1: testIsFrozen

 /**
  * @covers Symfony\Component\DependencyInjection\Container::isFrozen
  */
 public function testIsFrozen()
 {
     $sc = new Container(new ParameterBag(array('foo' => 'bar')));
     $this->assertFalse($sc->isFrozen(), '->isFrozen() returns false if the parameters are not frozen');
     $sc->freeze();
     $this->assertTrue($sc->isFrozen(), '->isFrozen() returns true if the parameters are frozen');
 }
开发者ID:netixpro,项目名称:symfony,代码行数:10,代码来源:ContainerTest.php

示例2: freeze

 /**
  * Freezes the container.
  *
  * This method does four things:
  *
  *  * The extension configurations are merged;
  *  * Parameter values are resolved;
  *  * The parameter bag is freezed;
  *  * Extension loading is disabled.
  */
 public function freeze()
 {
     $parameters = $this->parameterBag->all();
     $definitions = $this->definitions;
     $aliases = $this->aliases;
     foreach ($this->extensionContainers as $container) {
         $this->merge($container);
     }
     $this->extensionContainers = array();
     $this->addDefinitions($definitions);
     $this->addAliases($aliases);
     $this->parameterBag->add($parameters);
     parent::freeze();
 }
开发者ID:roydonstharayil,项目名称:sugarbox,代码行数:24,代码来源:ContainerBuilder.php

示例3: freeze

 /**
  * Freezes the container.
  *
  * This method does four things:
  *
  *  * The extension configurations are merged;
  *  * Parameter values are resolved;
  *  * The parameter bag is freezed;
  *  * Extension loading is disabled.
  */
 public function freeze()
 {
     foreach ($this->compilerPasses as $pass) {
         $pass->process($this);
     }
     parent::freeze();
 }
开发者ID:spf13,项目名称:symfony,代码行数:17,代码来源:ContainerBuilder.php

示例4: freeze

 /**
  * Freezes the container.
  *
  * This method does four things:
  *
  *  * The extension configurations are merged;
  *  * Parameter values are resolved;
  *  * The parameter bag is freezed;
  *  * Extension loading is disabled.
  */
 public function freeze()
 {
     $parameters = $this->parameterBag->all();
     $definitions = $this->definitions;
     $aliases = $this->aliases;
     foreach ($this->extensionConfigs as $name => $configs) {
         list($namespace, $tag) = explode(':', $name);
         $extension = $this->getExtension($namespace);
         $container = new self($this->parameterBag);
         $container->addObjectResource($extension);
         foreach ($configs as $config) {
             $extension->load($tag, $config, $container);
         }
         $this->merge($container);
     }
     $this->extensionConfigs = array();
     $this->addDefinitions($definitions);
     $this->addAliases($aliases);
     $this->parameterBag->add($parameters);
     parent::freeze();
 }
开发者ID:skoop,项目名称:symfony-sandbox,代码行数:31,代码来源:ContainerBuilder.php

示例5: freeze

    /**
     * Freezes the container.
     *
     * This method does four things:
     *
     *  * The extension configurations are merged;
     *  * Parameter values are resolved;
     *  * The parameter bag is freezed;
     *  * Extension loading is disabled.
     */
    public function freeze()
    {
        $parameters = $this->parameterBag->all();
        $definitions = $this->definitions;
        $aliases = $this->aliases;

        foreach ($this->extensionConfigs as $name => $configs) {
            list($namespace, $tag) = explode(':', $name);

            $extension = $this->getExtension($namespace);

            $container = new self($this->parameterBag);
            $container->addObjectResource($extension);
            foreach ($configs as $config) {
                $extension->load($tag, $config, $container);
            }

            $this->merge($container);
        }

        $this->extensionConfigs = array();
        $this->addDefinitions($definitions);
        $this->addAliases($aliases);
        $this->parameterBag->add($parameters);

        foreach ($this->definitions as $definition) {
            foreach ($this->injectors as $injector) {
                if (null !== $definition->getFactoryService()) {
                    continue;
                }
                $defClass = $this->parameterBag->resolveValue($definition->getClass());
                $definition->setClass($defClass);
                if ($injector->supports($defClass)) {
                    $injector->processDefinition($definition);
                }
            }
        }

        parent::freeze();
    }
开发者ID:pmjones,项目名称:php-framework-benchmarks,代码行数:50,代码来源:ContainerBuilder.php


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