Bug #89764

Boolean Container parameters are incompatible with Symfony 5.0

Added by Benjamin Franzke 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Must have
Category:
System/Bootstrap/Configuration
Start date:
2019-11-25
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Symfony 4.4 deprecated support for non-object services:
https://github.com/symfony/dependency-injection/commit/6f11b359ab9cc97838bc9fa7cf1480528bdcb54f

Symfony 5.0 introduced type declaration in Container->set which causes an exception when we set synthetic boolean services:
https://github.com/symfony/dependency-injection/blob/501d3378459fdc7993dc29b55c7d14fc27172768/Container.php#L144

Argument 2 passed to Symfony\Component\DependencyInjection\Container::set() must be an object or null, bool given, called in […]/typo3/sysext/core/Classes/DependencyInjection/ContainerBuilder.php on line 99

at Symfony\Component\DependencyInjection\Container->set('_early.env.is_unix', true)

Associated revisions

Revision ceafda03 (diff)
Added by Benjamin Franzke 6 months ago

[BUGFIX] Fix compatibility with symfony/dependency-injection:5.0

The recently released symfony 4.4 introduced a deprecation for
non-object services and so 5.0 dropped support.
That means we run into exception with symfony 5.0 when
we add synthetic non-object services. Symfony 5.0 contains
a type declaration that allows for objects only:

Argument 2 passed to
Symfony\Component\DependencyInjection\Container::set()
must be an object or null, bool given, called in
[…]/typo3/sysext/core/Classes/DependencyInjection/ContainerBuilder.php
on line 99
at
Symfony\Component\DependencyInjection\Container->set(
'_early.env.is_unix',
true
)

We provided four boolean services in v10.0 but never used
or documented these in core, therefore we drop them now:
- env.is_unix
- env.is_windows
- env.is_cli
- env.is_compoer_mode

These variales can actually be substitued by using dynamic
environment parameters (those are supported thanks to our
EnvVarProcessor):

- "%env(TYPO3:isUnix)%" 
- "%env(TYPO3:isWindows)%"
- "%env(TYPO3:isCli)%"
- "%env(TYPO3:isComposerMode)%"

One more, internally used, boolean service is now migrated into
the internal boot.state service:

- cache.disabled

Releases: master
Resolves: #89764
Change-Id: If40ef73fdce61a81732b9670876aec7c457648d5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62427
Reviewed-by: Frank Nägler <>
Reviewed-by: Richard Haeser <>
Tested-by: Frank Nägler <>
Tested-by: TYPO3com <>
Tested-by: Richard Haeser <>

History

#1 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62427

#2 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62427

#3 Updated by Benjamin Franzke 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF