Skip to content

Commit

Permalink
Merge branch '5.3' into 5.4
Browse files Browse the repository at this point in the history
* 5.3:
  [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
  [PropertyAccess] Fix handling of uninitialized property of anonymous class
  [FrameworkBundle] Allow default cache pools to be overwritten by user
  [DependencyInjection] fix test
  ResolveBindingsPass remove loading of class iterable
  [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
  [DependencyInjection] Fix nested env var with resolve processor
  Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
  allow a zero time-limit
  [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
  [Validators] Add translations for Slovak #43735
  • Loading branch information
nicolas-grekas committed Jan 12, 2022
2 parents be0d101 + 4437597 commit 2b25bce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
3 changes: 1 addition & 2 deletions Command/AssetsInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
/** @var KernelInterface $kernel */
$kernel = $this->getApplication()->getKernel();
$targetArg = rtrim($input->getArgument('target'), '/');

$targetArg = rtrim($input->getArgument('target') ?? '', '/');
if (!$targetArg) {
$targetArg = $this->getPublicDirectory($kernel->getContainer());
}
Expand Down
49 changes: 25 additions & 24 deletions DependencyInjection/FrameworkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,34 +341,10 @@ public function load(array $configs, ContainerBuilder $container)
}
}

// register cache before session so both can share the connection services
$this->registerCacheConfiguration($config['cache'], $container);

if ($this->isConfigEnabled($container, $config['session'])) {
if (!\extension_loaded('session')) {
throw new LogicException('Session support cannot be enabled as the session extension is not installed. See https://php.net/session.installation for instructions.');
}

$this->sessionConfigEnabled = true;
$this->registerSessionConfiguration($config['session'], $container, $loader);
if (!empty($config['test'])) {
// test listener will replace the existing session listener
// as we are aliasing to avoid duplicated registered events
$container->setAlias('session_listener', 'test.session.listener');
}
} elseif (!empty($config['test'])) {
$container->removeDefinition('test.session.listener');
}

if ($this->isConfigEnabled($container, $config['request'])) {
$this->registerRequestConfiguration($config['request'], $container, $loader);
}

if (null === $config['csrf_protection']['enabled']) {
$config['csrf_protection']['enabled'] = $this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle'], true);
}
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);

if ($this->isConfigEnabled($container, $config['form'])) {
if (!class_exists(Form::class)) {
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
Expand Down Expand Up @@ -501,6 +477,31 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerUidConfiguration($config['uid'], $container, $loader);
}

// register cache before session so both can share the connection services
$this->registerCacheConfiguration($config['cache'], $container);

if ($this->isConfigEnabled($container, $config['session'])) {
if (!\extension_loaded('session')) {
throw new LogicException('Session support cannot be enabled as the session extension is not installed. See https://php.net/session.installation for instructions.');
}

$this->sessionConfigEnabled = true;
$this->registerSessionConfiguration($config['session'], $container, $loader);
if (!empty($config['test'])) {
// test listener will replace the existing session listener
// as we are aliasing to avoid duplicated registered events
$container->setAlias('session_listener', 'test.session.listener');
}
} elseif (!empty($config['test'])) {
$container->removeDefinition('test.session.listener');
}

// csrf depends on session being registered
if (null === $config['csrf_protection']['enabled']) {
$config['csrf_protection']['enabled'] = $this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle'], true);
}
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);

$this->addAnnotatedClassesToCompile([
'**\\Controller\\',
'**\\Entity\\',
Expand Down

0 comments on commit 2b25bce

Please sign in to comment.