Skip to content

Commit

Permalink
[FrameworkBundle] fixed ESI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 23, 2011
1 parent a868561 commit 86b357d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -290,9 +290,11 @@ protected function registerTestConfiguration(array $config, ContainerBuilder $co
*/
protected function registerEsiConfiguration(array $config, ContainerBuilder $container)
{
if (!$container->hasDefinition('esi')) {
$loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config'));
$loader->load('esi.xml');
if (isset($config['esi']['enabled']) && $config['esi']['enabled']) {
if (!$container->hasDefinition('esi')) {
$loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config'));
$loader->load('esi.xml');
}
}
}

Expand Down
Expand Up @@ -17,6 +17,7 @@
<xsd:element name="translator" type="translator" minOccurs="0" maxOccurs="1" />
<xsd:element name="param-converter" type="param-converter" minOccurs="0" maxOccurs="1" />
<xsd:element name="csrf-protection" type="csrf_protection" minOccurs="0" maxOccurs="1" />
<xsd:element name="esi" type="esi" minOccurs="0" maxOccurs="1" />
</xsd:all>

<xsd:attribute name="ide" type="xsd:string" />
Expand Down Expand Up @@ -84,4 +85,8 @@
<xsd:attribute name="field-name" type="xsd:string" />
<xsd:attribute name="secret" type="xsd:string" />
</xsd:complexType>
</xsd:schema>

<xsd:complexType name="esi">
<xsd:attribute name="enabled" type="xsd:boolean" />
</xsd:complexType>
</xsd:schema>

0 comments on commit 86b357d

Please sign in to comment.