Task #89892

Define singletons used in install tool in service providers

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

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Start date:
2019-12-06
Due date:
% Done:

100%

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

Description

This will allow both, dependency injection for these services and usage in install tool.
This is possible thanks to the failsafe container and the service providers which can fed the failsafe container with service factories, where we can wire services manually.

Note: The definition in a service provider means we are required to use manual wiring
and are forced to define the dependencies in the service provider.
With that approach we can assure that a servie, that is used in install tool,
doesn't add new dependencies without defining a factory in a service provider.


Related issues

Related to TYPO3 Core - Bug #91260: \TYPO3\CMS\Core\Configuration\SiteConfiguration cannot be overridden with XCLASS Closed 2020-05-01

Associated revisions

Revision c020e9ba (diff)
Added by Benjamin Franzke about 2 months ago

[TASK] Inject singletons used by EXT:install in service providers

This will allow both, dependency injection for these services (manually
wired in service providers), and usage in install/maintenance tool
(where we do not use the caching symfony container for basic tasks).

The move to DI is possible thanks to the failsafe container and the
service providers which can fed the failsafe container with service
factories. These factories are used to wire services manually.

Notes:

  • The definition in a service provider means we are required to use
    manual wiring and are forced to define the dependencies in the service
    provider when we add new depenencies to services that are being used
    by the install..
    With that approach we can assure that we do not accidentally add new
    dependencies to services which would become available in symfony DI due
    to autowiring, but would be unavailable in the install tool.
  • The install tool has operations that require a booted symfony
    container which is provided by the LateBootService. Services that
    are used in that mode do not need to be listed in service providers.
    Therefore we do only add core services to service providers if they
    are used in a context without a fully booted symfony DI container.
  • GLOBALS['LANG'] mocks in Core\Tests\Unit\DataHandling\DataHandlerTest
    have been removed as the code under test does no longer use
    $GLOBALS['LANG']->csConvObj->substr() but mb_substr. The test had been
    introduced with #68602 but the tested code was adapted in #78670.
  • We got a bit ugly constructs now, where a unit(!) test previously used

    $GLOBALS['LANG'] = new LanguageService();

    …we now have to encode the dependency structure:

    $GLOBALS['LANG'] = new LanguageService(new Locales,
    new LocalizationFactory(
    new LanguageStore,
    $cacheManagerProphecy->reveal()
    )
    );

    This isn't nice, but this change reveals that the affected unit tests
    should either be adapted, removed or be moved to a functional test.
    Such adaption are out of scope for this change.

  • loadExtLocalconfDatabaseAndExtTables() is removed from the
    EXT:install AbstractController, as it hides the implicit dependency
    to LateBootService
  • Nullable constructor arguments have been changed to be non-nullable
    whenever possible. That results in some more test adaptions, but
    reveals, where unit tests rely on implicit dependencies and offers
    better readability and less possible codepaths.

Releases: master
Resolves: #89892
Resolves: #89891
Change-Id: Ib72d6440f81b2c0d05279e8768697c3b48aecfe4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62575
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Tested-by: Susanne Moog <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Susanne Moog <>

Revision 36b4e32f (diff)
Added by Benjamin Franzke about 2 months ago

[BUGIX] Register MetaDataRepository via service provider

The installtool sends a mail when a login happens when
TYPO3_CONF_VARS.BE.warning_email_addr is set.
When TYPO3_CONF_VARS.EXTENSIONS.backend.loginLogo is set
to provide a custom backend logo, that logo is used by
the FluidEmail template via f:image viewhelper.

Therefore we need to provide MetaDataRepository,
as the f:image viewhelper will use that service.
The (implicit) dependency chain is:

&lt;f:image&gt;
-> Resource\File
-> MetaDataAspect
-> MetaDataRepository

Releases: master
Resolves: #91107
Related: #89892
Change-Id: If4e73d607d2a6e21646ea91bd8f0a39742f133d4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64236
Tested-by: TYPO3com <>
Tested-by: Jonas Eberle <>
Tested-by: Alexander Schnitzler <>
Tested-by: Georg Ringer <>
Reviewed-by: Alexander Schnitzler <>
Reviewed-by: Georg Ringer <>

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/+/62575

#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/+/62575

#3 Updated by Gerrit Code Review 6 months ago

Patch set 3 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/+/62575

#4 Updated by Gerrit Code Review 6 months ago

Patch set 4 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/+/62575

#5 Updated by Gerrit Code Review 6 months ago

Patch set 5 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/+/62575

#6 Updated by Gerrit Code Review 6 months ago

Patch set 6 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/+/62575

#7 Updated by Gerrit Code Review 6 months ago

Patch set 7 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/+/62575

#8 Updated by Gerrit Code Review 6 months ago

Patch set 8 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/+/62575

#9 Updated by Gerrit Code Review 5 months ago

Patch set 9 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/+/62575

#10 Updated by Gerrit Code Review 4 months ago

Patch set 10 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/+/62575

#11 Updated by Gerrit Code Review 4 months ago

Patch set 11 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/+/62575

#12 Updated by Gerrit Code Review 4 months ago

Patch set 12 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/+/62575

#13 Updated by Gerrit Code Review 4 months ago

Patch set 13 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/+/62575

#14 Updated by Gerrit Code Review 4 months ago

Patch set 14 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/+/62575

#15 Updated by Gerrit Code Review about 2 months ago

Patch set 15 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/+/62575

#16 Updated by Gerrit Code Review about 2 months ago

Patch set 16 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/+/62575

#17 Updated by Gerrit Code Review about 2 months ago

Patch set 17 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/+/62575

#18 Updated by Gerrit Code Review about 2 months ago

Patch set 18 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/+/62575

#19 Updated by Gerrit Code Review about 2 months ago

Patch set 19 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/+/62575

#20 Updated by Gerrit Code Review about 2 months ago

Patch set 20 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/+/62575

#21 Updated by Gerrit Code Review about 2 months ago

Patch set 21 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/+/62575

#22 Updated by Gerrit Code Review about 2 months ago

Patch set 22 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/+/62575

#23 Updated by Gerrit Code Review about 2 months ago

Patch set 23 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/+/62575

#24 Updated by Gerrit Code Review about 2 months ago

Patch set 24 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/+/62575

#25 Updated by Gerrit Code Review about 2 months ago

Patch set 25 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/+/62575

#26 Updated by Gerrit Code Review about 2 months ago

Patch set 26 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/+/62575

#27 Updated by Gerrit Code Review about 2 months ago

Patch set 27 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/+/62575

#28 Updated by Gerrit Code Review about 2 months ago

Patch set 28 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/+/62575

#29 Updated by Gerrit Code Review about 2 months ago

Patch set 29 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/+/62575

#30 Updated by Gerrit Code Review about 2 months ago

Patch set 30 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/+/62575

#31 Updated by Gerrit Code Review about 2 months ago

Patch set 31 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/+/62575

#32 Updated by Benjamin Franzke about 2 months ago

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

#33 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

#34 Updated by Helmut Hummel about 1 month ago

  • Related to Bug #91260: \TYPO3\CMS\Core\Configuration\SiteConfiguration cannot be overridden with XCLASS added

Also available in: Atom PDF