Skip to content

Commit d23b29d

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: Compare paths after realpath() has been applied to both fix AssetMapper usage without assets enabled Bump Symfony version to 7.1.3 Update VERSION for 7.1.2 Update CHANGELOG for 7.1.2 Bump Symfony version to 7.0.10 Update VERSION for 7.0.9 Update CHANGELOG for 7.0.9 Bump Symfony version to 6.4.10 Update VERSION for 6.4.9 Update CHANGELOG for 6.4.9
2 parents c535327 + 9799901 commit d23b29d

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,10 @@ private function registerAssetMapperConfiguration(array $config, ContainerBuilde
13001300
{
13011301
$loader->load('asset_mapper.php');
13021302

1303+
if (!$assetEnabled) {
1304+
$container->removeDefinition('asset_mapper.asset_package');
1305+
}
1306+
13031307
if (!$httpClientEnabled) {
13041308
$container->register('asset_mapper.http_client', HttpClientInterface::class)
13051309
->addTag('container.error')
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'annotations' => false,
5+
'asset_mapper' => null,
6+
'assets' => false,
7+
'handle_all_throwables' => true,
8+
'http_method_override' => false,
9+
'php_errors' => ['log' => true],
10+
]);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config http-method-override="false" handle-all-throwables="true">
9+
<framework:annotations enabled="false" />
10+
<framework:asset-mapper enabled="true" />
11+
<framework:assets enabled="false" />
12+
<framework:php-errors log="true" />
13+
</framework:config>
14+
</container>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
framework:
2+
annotations: false
3+
asset_mapper: ~
4+
assets: false
5+
handle_all_throwables: true
6+
http_method_override: false
7+
php_errors:
8+
log: true

Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,16 @@ public function testWebhookWithoutSerializer()
23762376
);
23772377
}
23782378

2379+
public function testAssetMapperWithoutAssets()
2380+
{
2381+
$container = $this->createContainerFromFile('asset_mapper_without_assets');
2382+
2383+
$this->assertTrue($container->has('asset_mapper'));
2384+
$this->assertFalse($container->has('asset_mapper.asset_package'));
2385+
$this->assertFalse($container->has('assets.packages'));
2386+
$this->assertFalse($container->has('assets._default_package'));
2387+
}
2388+
23792389
protected function createContainer(array $data = [])
23802390
{
23812391
return new ContainerBuilder(new EnvPlaceholderParameterBag(array_merge([

0 commit comments

Comments
 (0)