本文整理汇总了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');
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}