Review main Merged

62826[TASK] Instantiate $GLOBALS[LANG] via factory

Benni Mack CR +2 V +2 Normal +63 −35 updated 01/14/20, 11:48

Commit message

LanguageService a.k.a. $GLOBALS[LANG] is used in various places,
not just for backend-labels anymore. The "init()" method (which stems
from the fact that PHP did not have constructors !!! back then), should
be covered - which is now done via factory methods.

The goal of the factory methods are to explicitly define the dependencies
where LanguageService is used, instead of calling "init()" in the emitters
code.

This change is a pre-cursor for TYPO3 to
- avoid accessing Bootstrap API for initializing $GLOBALS[LANG]
- streamline the various places where this API is instantiated
- have a first step to switch to "real" locales at _some_ point
- and eventually get rid of accessing LanguageService via globals.

In addition the PHP class comments are streamlined to reflect
the purpose of this class.

The next step is to adapt the testing framework to easily use this
API so our tests will not have to worry about $GLOBALS[LANG]
anymore.

My 2c: We should actually rename "LanguageService" to "LabelService"
or "LabelProvider" at some point.

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Sascha Rademacher +1
    • Jörg Bösche +1
    • Henning Liebe +1
    • Felix P. +1
  • Verified V +2 Done
    • Susi Moog +2
    • Sascha Rademacher +1
    • Jörg Bösche +1
    • Henning Liebe +1
    • Felix P. +1
    • TYPO3com +1 CI

Issues 1

Files 12

Review log 1217

  1. Benni Mack uploaded patch set 1 01/07/20, 08:26

  2. TYPO3com voted on patch set 1 V -1 01/07/20, 08:33 Completed build in 07m 12s on Tue, 7 Jan, 08:33 AM Test Summary: 9 of 69608 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39728

  3. Andreas Kienast commented on patch set 1 CR -1 01/07/20, 08:39

    LanguageService.php:427 Unresolved

    IMO we should check for an undefined uc['lang'] as well.
  4. Benni Mack uploaded patch set 2 01/07/20, 09:03

  5. TYPO3com voted on patch set 2 V +1 01/07/20, 09:10 Completed build in 06m 56s on Tue, 7 Jan, 09:10 AM Test Summary: 69242 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39729

  6. Georg Ringer voted on patch set 2 V +1 CR +1 01/09/20, 07:23

  7. Benni Mack uploaded patch set 3 01/09/20, 12:10

  8. TYPO3com voted on patch set 3 V -1 01/09/20, 12:33 Completed build in 23m 07s on Thu, 9 Jan, 12:33 PM Test Summary: 3 of 69618 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39765

  9. TYPO3com voted on patch set 3 V +1 01/09/20, 20:46 Completed build in 8h 59m 08s on Thu, 9 Jan, 08:46 PM Test Summary: 69179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39765

  10. Benni Mack uploaded patch set 4 01/14/20, 10:13

  11. TYPO3com voted on patch set 4 V +1 01/14/20, 10:22 Completed build in 08m 30s on Tue, 14 Jan, 10:22 AM Test Summary: 69566 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39887

  12. Jörg Bösche commented on patch set 4 V +1 CR +1 01/14/20, 10:23

    Verified on v10.3.0-dev
  13. Sascha Rademacher voted on patch set 4 V +1 CR +1 01/14/20, 11:13

  14. Henning Liebe voted on patch set 4 V +1 CR +1 01/14/20, 11:14

  15. Susi Moog voted on patch set 4 V +2 CR +2 01/14/20, 11:43

  16. Susi Moog merged patch set 5 01/14/20, 11:43

  17. Felix P. voted on patch set 5 V +1 CR +1 01/14/20, 11:48