[BUGFIX] Do not depend on global env to define cli mode 16/57816/15
authorHelmut Hummel <typo3@helhum.io>
Sun, 5 Aug 2018 10:42:50 +0000 (12:42 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 21 Aug 2018 08:42:20 +0000 (10:42 +0200)
commit18cffa12268e299bbf0e7273734d9cfabae0ae99
tree40b17e3c51afacceec51f8780817ffafd568bbe8
parent963eb27a7c3c06049e55fedf65e51290f3b8a39f
[BUGFIX] Do not depend on global env to define cli mode

Instead of depending on a global environment variable
to set the TYPO3 environment in cli mode, we inject the mode
properly from within the entry point.

We now move the code to initialize the environment
to SystemEnvironmentBuilder:run() where we can evaluate
the request type passed to this method, to properly
set cli or non cli mode.

Depending on a global env to set the TYPO3 environment
would require hacks, like changing the global env to
properly select the cli mode (currently done in testing framework).
Using an application sub context for that purpose isn't ideal either,
because at best we would need to also test for magic contexts
like "Production/Frontend" or "Development/Frontend" and at worst
it conflicts with user defined contexts. It wouldn't be possible
to define a sub context and still properly start a frontend application
within this context.

composer req --dev typo3/testing-framework ~4.4.1

Resolves: #85757
Releases: master
Change-Id: Ia64d358e731d9ddf717497ae120acb009e0f26fa
Reviewed-on: https://review.typo3.org/57816
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
composer.json
composer.lock
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/composer.json