Review main Merged

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

Benjamin Franzke CR +2 V +2 Expert +873 −309 updated 04/17/20, 12:24

Commit message

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.

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Andreas Kienast +1
  • Verified V +2 Done
    • Susi Moog +2
    • Andreas Kienast +1
    • TYPO3com +1 CI

Issues 2

Files 45

Show 25 more files

Review log 4177

Show 2552 earlier messages
  1. Benjamin Franzke uploaded patch set 1 12/06/19, 22:15

  2. TYPO3com voted on patch set 1 V -1 12/06/19, 22:24 Completed build in 09m 08s on Fri, 6 Dec, 10:24 PM Test Summary: 6 of 69161 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39232

  3. Benjamin Franzke uploaded patch set 2 12/10/19, 20:47

  4. Benjamin Franzke wrote 12/10/19, 20:54

    Topic set to di
  5. TYPO3com voted on patch set 2 V -1 12/10/19, 20:54 Completed build in 07m 22s on Tue, 10 Dec, 08:54 PM Test Summary: 12 of 69161 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39316

  6. Benjamin Franzke uploaded patch set 3 12/10/19, 21:41

  7. TYPO3com voted on patch set 3 V -1 12/10/19, 21:49 Completed build in 07m 38s on Tue, 10 Dec, 09:49 PM Test Summary: 68698 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39317

  8. TYPO3com commented on patch set 3 12/10/19, 22:08 Completed build in 17m 37s on Tue, 10 Dec, 10:08 PM Test Summary: 1 of 68636 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39318

  9. TYPO3com voted on patch set 3 V +1 12/10/19, 22:39 Completed build in 22m 50s on Tue, 10 Dec, 10:39 PM Test Summary: 68705 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39319

  10. Benjamin Franzke uploaded patch set 4 12/11/19, 06:53

  11. TYPO3com voted on patch set 4 V +1 12/11/19, 07:44 Completed build in 42m 02s on Wed, 11 Dec, 07:44 AM Test Summary: 68702 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39322

  12. Benjamin Franzke uploaded patch set 5 12/11/19, 09:42

  13. TYPO3com voted on patch set 5 V -1 12/11/19, 10:19 Completed build in 37m 06s on Wed, 11 Dec, 10:19 AM Test Summary: 3 of 69164 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39328

  14. Benjamin Franzke uploaded patch set 6 12/11/19, 13:04

  15. TYPO3com voted on patch set 6 V +1 12/11/19, 13:11 Completed build in 07m 27s on Wed, 11 Dec, 01:11 PM Test Summary: 68712 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39335

  16. Benjamin Franzke uploaded patch set 7 12/11/19, 13:40

  17. TYPO3com voted on patch set 7 V +1 12/11/19, 14:02 Completed build in 21m 34s on Wed, 11 Dec, 02:02 PM Test Summary: 68714 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39337

  18. Benjamin Franzke uploaded patch set 8 12/13/19, 15:13

  19. TYPO3com voted on patch set 8 V -1 12/13/19, 15:13 Completed build in 22s on Fri, 13 Dec, 03:13 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39396

  20. Daniel Goerz uploaded patch set 9 01/14/20, 11:45

  21. TYPO3com voted on patch set 9 V -1 01/14/20, 11:51 Completed build in 06m 18s on Tue, 14 Jan, 11:51 AM Test Summary: 10980 of 69932 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39895

  22. Benjamin Franzke uploaded patch set 10 01/29/20, 09:28

  23. TYPO3com voted on patch set 10 V -1 01/29/20, 09:37 Completed build in 09m 45s on Wed, 29 Jan, 09:37 AM Test Summary: 12277 of 71194 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40310

  24. Benjamin Franzke uploaded patch set 11 01/29/20, 15:06

  25. TYPO3com voted on patch set 11 V -1 01/29/20, 15:23 Completed build in 15m 06s on Wed, 29 Jan, 03:23 PM Test Summary: 348 of 71278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40326

  26. Benjamin Franzke uploaded patch set 12 01/29/20, 15:40

  27. TYPO3com voted on patch set 12 V -1 01/29/20, 15:53 Completed build in 13m 06s on Wed, 29 Jan, 03:53 PM Test Summary: 348 of 61168 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40329

  28. Benjamin Franzke uploaded patch set 13 01/29/20, 16:14

  29. TYPO3com voted on patch set 13 V +1 01/29/20, 16:36 Completed build in 21m 08s on Wed, 29 Jan, 04:36 PM Test Summary: 70840 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40334

  30. Benni Mack uploaded patch set 14 02/15/20, 09:42

  31. TYPO3com voted on patch set 14 V +1 02/15/20, 09:57 Completed build in 14m 35s on Sat, 15 Feb, 09:57 AM Test Summary: 71295 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-101

  32. Benjamin Franzke uploaded patch set 15 04/13/20, 05:27

  33. TYPO3com voted on patch set 15 V +1 04/13/20, 05:38 Completed build in 10m 33s on Mon, 13 Apr, 05:38 AM Test Summary: 73409 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2419

  34. Benjamin Franzke uploaded patch set 16 04/13/20, 12:07

  35. TYPO3com voted on patch set 16 V -1 04/13/20, 12:30 Completed build in 22m 37s on Mon, 13 Apr, 12:30 PM Test Summary: 73089 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2440

  36. TYPO3com commented on patch set 16 04/13/20, 14:04 Completed build in 36m 51s on Mon, 13 Apr, 02:04 PM Test Summary: 73409 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2446

  37. Benjamin Franzke uploaded patch set 17 04/13/20, 15:02

  38. TYPO3com voted on patch set 17 V +1 04/13/20, 15:14 Completed build in 12m 09s on Mon, 13 Apr, 03:14 PM Test Summary: 73409 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2450

  39. Benjamin Franzke uploaded patch set 18 04/15/20, 18:01

  40. TYPO3com voted on patch set 18 V +1 04/15/20, 18:15 Completed build in 13m 45s on Wed, 15 Apr, 06:15 PM Test Summary: 73571 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2603

  41. Benjamin Franzke uploaded patch set 19 04/16/20, 08:16

  42. TYPO3com voted on patch set 19 V +1 04/16/20, 08:29 Completed build in 13m 20s on Thu, 16 Apr, 08:29 AM Test Summary: 73571 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2639

  43. Benjamin Franzke uploaded patch set 20 04/16/20, 13:38

  44. TYPO3com voted on patch set 20 V -1 04/16/20, 13:49 Completed build in 10m 47s on Thu, 16 Apr, 01:49 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2649

  45. Benjamin Franzke uploaded patch set 21 04/16/20, 14:20

  46. TYPO3com voted on patch set 21 V +1 04/16/20, 14:33 Completed build in 13m 26s on Thu, 16 Apr, 02:33 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2651

  47. Benjamin Franzke uploaded patch set 22 04/16/20, 15:09

  48. TYPO3com voted on patch set 22 V +1 04/16/20, 18:21 Completed build in 12m 14s on Thu, 16 Apr, 06:21 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2661

  49. Benjamin Franzke uploaded patch set 23 04/16/20, 21:53

  50. TYPO3com voted on patch set 23 V +1 04/16/20, 22:05 Completed build in 11m 57s on Thu, 16 Apr, 10:05 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2671

  51. Benjamin Franzke uploaded patch set 24 04/16/20, 22:13

  52. TYPO3com voted on patch set 24 V +1 04/16/20, 22:25 Completed build in 11m 23s on Thu, 16 Apr, 10:25 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2673

  1. Benjamin Franzke uploaded patch set 25 04/16/20, 22:49

  2. TYPO3com voted on patch set 25 V +1 04/16/20, 23:01 Completed build in 11m 43s on Thu, 16 Apr, 11:01 PM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2674

  3. Andreas Kienast voted on patch set 25 V +1 CR +1 04/17/20, 05:48

  4. Benni Mack commented on patch set 25 04/17/20, 06:06

    LanguageService.php:117

    pretty please let's make this one internal, as the Factory methods should be used instead.
  5. Benjamin Franzke commented on patch set 25 CR -1 04/17/20, 06:36

    LanguageService.php:117 Reply

    Oh shit… so this isn't a service but rather a prototype – I completely missed that :\ I thought it would only be applied to $GLOBALS['LANG'] but it seems TSFE wants an own instance(?). I'll have to look into that…
  6. Benjamin Franzke commented on patch set 25 04/17/20, 06:43

    LanguageService.php:117 Reply

    LanguageService as singleton will result in bugs e.g. for the admin panel. When backend language is german, but site language is english, then the admin panel is rendering in english, instead of german with this patch applied. So this'll need adaptions.
  7. Benni Mack commented on patch set 25 04/17/20, 06:52

    LanguageService.php:117 Reply

    that's why I introduced factory methods in TYPO3 v10.3.
  8. Benjamin Franzke uploaded patch set 26 04/17/20, 07:35

  9. Benjamin Franzke uploaded patch set 27 04/17/20, 07:42

  10. TYPO3com voted on patch set 26 V -1 04/17/20, 07:48 Completed build in 12m 58s on Fri, 17 Apr, 07:48 AM Test Summary: 758 of 74048 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2689

  11. Benjamin Franzke uploaded patch set 28 04/17/20, 07:57

  12. TYPO3com voted on patch set 27 V -1 04/17/20, 08:03 Completed build in 17m 27s on Fri, 17 Apr, 08:03 AM Test Summary: 758 of 74048 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2691

  13. TYPO3com voted on patch set 28 V -1 04/17/20, 08:13 Completed build in 14m 31s on Fri, 17 Apr, 08:13 AM Test Summary: 624 of 74048 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2693

  14. Benjamin Franzke uploaded patch set 29 04/17/20, 08:15

  15. Benjamin Franzke uploaded patch set 30 04/17/20, 08:20

  16. TYPO3com voted on patch set 29 V -1 04/17/20, 08:23 Completed build in 02m 22s on Fri, 17 Apr, 08:23 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2698

  17. Benjamin Franzke commented on patch set 30 04/17/20, 08:23

    LanguageService.php:117 Reply

    I see. I've therefore now added a (internal) LanguageServiceFactory which is used as "backend" for the LanguageService factory methods you introduced (to be able to properly fetch the dependencies). The LanguageService constructor is now additionally marked @internal. For compatibility with code that still uses makeInstance(LanguageService::class) I also added a symfony DI entry, but marked it to be deprecated. The changes are best viewed when patchsets 26,27,28,29 are skipped, as I had to revert some changes in between. Therefore simply compare 25 to 30. https://review.typo3.org/c/Packages/TYPO3.CMS/+/62575/25..30
  18. TYPO3com voted on patch set 30 V -1 04/17/20, 08:46 Completed build in 23m 50s on Fri, 17 Apr, 08:46 AM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2700

  19. Benjamin Franzke uploaded patch set 31 04/17/20, 09:00

  20. TYPO3com voted on patch set 31 V -1 04/17/20, 09:40 Completed build in 40m 09s on Fri, 17 Apr, 09:40 AM Test Summary: 16 of 72762 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2702

  21. TYPO3com voted on patch set 31 V +1 04/17/20, 10:33 Completed build in 29m 01s on Fri, 17 Apr, 10:33 AM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2707

  22. TYPO3com commented on patch set 31 04/17/20, 10:41 Completed build in 2h 21m 07s on Fri, 17 Apr, 10:41 AM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2702

  23. Andreas Kienast voted on patch set 31 V +1 CR +1 04/17/20, 11:39

  24. Susi Moog voted on patch set 31 V +2 CR +2 04/17/20, 12:23

  25. Susi Moog merged patch set 32 04/17/20, 12:24