[FrameworkBundle] Allow to disable assets via framework:assets xml configuration
This commit is contained in:
parent
4910ac6fe9
commit
8579e24750
@ -138,6 +138,7 @@
|
|||||||
<xsd:element name="package" type="package" minOccurs="0" maxOccurs="unbounded" />
|
<xsd:element name="package" type="package" minOccurs="0" maxOccurs="unbounded" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
|
|
||||||
|
<xsd:attribute name="enabled" type="xsd:boolean" />
|
||||||
<xsd:attribute name="base-path" type="xsd:string" />
|
<xsd:attribute name="base-path" type="xsd:string" />
|
||||||
<xsd:attribute name="version-strategy" type="xsd:string" />
|
<xsd:attribute name="version-strategy" type="xsd:string" />
|
||||||
<xsd:attribute name="version" type="xsd:string" />
|
<xsd:attribute name="version" type="xsd:string" />
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$container->loadFromExtension('framework', array(
|
||||||
|
'assets' => array(
|
||||||
|
'enabled' => false,
|
||||||
|
),
|
||||||
|
));
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
|
||||||
|
<container xmlns="http://symfony.com/schema/dic/services"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||||
|
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||||
|
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||||
|
|
||||||
|
<framework:config>
|
||||||
|
<framework:assets enabled="false" />
|
||||||
|
</framework:config>
|
||||||
|
</container>
|
@ -0,0 +1,3 @@
|
|||||||
|
framework:
|
||||||
|
assets:
|
||||||
|
enabled: false
|
@ -423,6 +423,13 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||||||
$this->assertEquals('assets.custom_version_strategy', (string) $defaultPackage->getArgument(1));
|
$this->assertEquals('assets.custom_version_strategy', (string) $defaultPackage->getArgument(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testAssetsCanBeDisabled()
|
||||||
|
{
|
||||||
|
$container = $this->createContainerFromFile('assets_disabled');
|
||||||
|
|
||||||
|
$this->assertFalse($container->has('templating.helper.assets'), 'The templating.helper.assets helper service is removed when assets are disabled.');
|
||||||
|
}
|
||||||
|
|
||||||
public function testWebLink()
|
public function testWebLink()
|
||||||
{
|
{
|
||||||
$container = $this->createContainerFromFile('web_link');
|
$container = $this->createContainerFromFile('web_link');
|
||||||
|
Reference in New Issue
Block a user