Skip to content

Commit 54a84f4

Browse files
Merge branch '7.0' into 7.1
* 7.0: [HttpClient][Mailer] Revert "Let curl handle transfer encoding", use HTTP/1.1 for Mailgun Reviewed Catalan missing translations [AssetMapper] Upgrade importmap polyfill Fix typo: synchronous -> synchronously [Serializer] Check if exception message in test is correct Ibexa is sponsoring Symfony 5.4, thanks to them! \o/ [VarDumper] Fix `FFICaster` test to be platform-adaptable [String] Add `alias` case to `EnglishInflector` [FrameworkBundle] Throw runtime exception when trying to use asset-mapper while http-client is disabled [SecurityBundle] Remove unused memory users’ `name` attribute from the XSD [VarExporter] generate __doUnserialize() method in ProxyHelper::generateLazyProxy() Double check if pcntl function exists Add additional headers in Scaleway bridge [VarDumper] Fix FFI caster test [DependencyInjection] Add test coverage for `AutowireCallable::buildDefinition()`
2 parents 35d085d + 122109f commit 54a84f4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

DependencyInjection/FrameworkExtension.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public function load(array $configs, ContainerBuilder $container): void
344344
throw new LogicException('AssetMapper support cannot be enabled as the AssetMapper component is not installed. Try running "composer require symfony/asset-mapper".');
345345
}
346346

347-
$this->registerAssetMapperConfiguration($config['asset_mapper'], $container, $loader, $this->readConfigEnabled('assets', $container, $config['assets']));
347+
$this->registerAssetMapperConfiguration($config['asset_mapper'], $container, $loader, $this->readConfigEnabled('assets', $container, $config['assets']), $this->readConfigEnabled('http_client', $container, $config['http_client']));
348348
} else {
349349
$container->removeDefinition('cache.asset_mapper');
350350
}
@@ -1291,12 +1291,14 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
12911291
}
12921292
}
12931293

1294-
private function registerAssetMapperConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader, bool $assetEnabled): void
1294+
private function registerAssetMapperConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader, bool $assetEnabled, bool $httpClientEnabled): void
12951295
{
12961296
$loader->load('asset_mapper.php');
12971297

1298-
if (!$assetEnabled) {
1299-
$container->removeDefinition('asset_mapper.asset_package');
1298+
if (!$httpClientEnabled) {
1299+
$container->register('asset_mapper.http_client', HttpClientInterface::class)
1300+
->addTag('container.error')
1301+
->addError('You cannot use the AssetMapper integration since the HttpClient component is not enabled. Try enabling the "framework.http_client" config option.');
13001302
}
13011303

13021304
$paths = $config['paths'];

Resources/config/asset_mapper.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
])
5555
->alias(AssetMapperInterface::class, 'asset_mapper')
5656

57+
->alias('asset_mapper.http_client', 'http_client')
58+
5759
->set('asset_mapper.mapped_asset_factory', MappedAssetFactory::class)
5860
->args([
5961
service('asset_mapper.public_assets_path_resolver'),
@@ -197,7 +199,7 @@
197199
])
198200

199201
->set('asset_mapper.importmap.resolver', JsDelivrEsmResolver::class)
200-
->args([service('http_client')])
202+
->args([service('asset_mapper.http_client')])
201203

202204
->set('asset_mapper.importmap.renderer', ImportMapRenderer::class)
203205
->args([
@@ -212,12 +214,12 @@
212214
->set('asset_mapper.importmap.auditor', ImportMapAuditor::class)
213215
->args([
214216
service('asset_mapper.importmap.config_reader'),
215-
service('http_client'),
217+
service('asset_mapper.http_client'),
216218
])
217219
->set('asset_mapper.importmap.update_checker', ImportMapUpdateChecker::class)
218220
->args([
219221
service('asset_mapper.importmap.config_reader'),
220-
service('http_client'),
222+
service('asset_mapper.http_client'),
221223
])
222224

223225
->set('asset_mapper.importmap.command.require', ImportMapRequireCommand::class)

0 commit comments

Comments
 (0)