66060[TASK] Deprecate Extbase EnvironmentService
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Christian Kuhn +1
-
Verified V +2 Done
- Benni Mack +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 2
Files 28
- typo3/sysext/core/Classes/Database/QueryGenerator.php+3 −1
- typo3/sysext/core/Documentation/Changelog/master/Deprecation-92494-ExtbaseEnvironmentService.rstnew+43 −0
- typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php+8 −13
- typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php+7 −14
- typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php+1 −4
- typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php2+9 −19
- typo3/sysext/extbase/Classes/Mvc/Web/BackendRequestHandler.php+8 −8
- typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php+5 −5
- typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php+2 −15
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php+5 −15
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php+5 −15
- typo3/sysext/extbase/Classes/Persistence/Generic/Typo3QuerySettings.php+8 −16
- typo3/sysext/extbase/Classes/Service/EnvironmentService.php6+6 −0
- typo3/sysext/extbase/Classes/Service/ImageService.php+10 −10
- typo3/sysext/extbase/Classes/ServiceProvider.php+5 −2
- typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ActionControllerArgumentTest.php+4 −0
- typo3/sysext/extbase/Tests/Functional/Mvc/Web/RequestBuilderTest.php+2 −1
- typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php+4 −9
- typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php+4 −9
- typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php+6 −9
Show 8 more files
- typo3/sysext/extbase/Tests/Functional/Service/ExtensionServiceTest.php+8 −25
- typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php+0 −2
- typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php+11 −7
- typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php2+14 −13
- typo3/sysext/extbase/Tests/Unit/Service/ImageScriptServiceTest.php+7 −10
- typo3/sysext/fluid/Classes/View/StandaloneView.php+5 −2
- typo3/sysext/form/Classes/Mvc/Configuration/ConfigurationManager.php+5 −1
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php+5 −0
Review log 5071
Show 3546 earlier messages
-
Alexander Schnitzler uploaded patch set 1 10/06/20, 15:13
-
Alexander Schnitzler wrote 10/06/20, 15:13
Topic set to extbase -
TYPO3com voted on patch set 1 V -1 10/06/20, 15:31 Completed build in 16m 11s on Tue, 6 Oct, 03:31 PM Test Summary: 2006 of 74270 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6287
-
Alexander Schnitzler uploaded patch set 2 10/06/20, 16:44
-
TYPO3com voted on patch set 2 V -1 10/06/20, 16:44 Completed build in 26s on Tue, 6 Oct, 04:44 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6293
-
Alexander Schnitzler uploaded patch set 3 10/06/20, 16:44
-
TYPO3com voted on patch set 3 V +1 10/06/20, 16:59 Completed build in 14m 13s on Tue, 6 Oct, 04:59 PM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6294
-
Alexander Schnitzler updated the commit message in patch set 4 10/06/20, 17:03
-
Georg Ringer commented on patch set 4 10/06/20, 17:07
so this is a breaking change and needs a rst? -
Alexander Schnitzler commented on patch set 4 10/06/20, 17:19
Unresolved
instantiatable -
TYPO3com voted on patch set 4 V +1 10/06/20, 17:19 Completed build in 15m 49s on Tue, 6 Oct, 05:19 PM Test Summary: 73783 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6295
-
Alexander Schnitzler commented on patch set 4 10/06/20, 17:21
> Patch Set 4: > > so this is a breaking change and needs a rst? Well, it depends on what we think is breaking. The class itself is marked internal, so I think it's not breaking. People shouldn't have used the instances even if available in several non internal classes as properties. -
Alexander Schnitzler uploaded patch set 5 10/07/20, 10:41
-
Alexander Schnitzler commented on patch set 5 10/07/20, 10:41
@Georg Ringer. I marked the patch breaking just in case people used the injected service and the non internally marked public methods. -
TYPO3com voted on patch set 5 V +1 10/07/20, 11:03 Completed build in 22m 51s on Wed, 7 Oct, 11:03 AM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6316
-
Alexander Schnitzler uploaded patch set 6 10/20/20, 13:20
-
Markus Klein commented on patch set 6 10/20/20, 13:27
Breaking-92494-MakeEnvironmentServiceAStaticClass.rst:13UnresolvedprinciplesBreaking-92494-MakeEnvironmentServiceAStaticClass.rst:15UnresolvedexceptBreaking-92494-MakeEnvironmentServiceAStaticClass.rst:41UnresolvedCore -
TYPO3com voted on patch set 6 V +1 10/20/20, 13:33 Completed build in 13m 08s on Tue, 20 Oct, 01:33 PM Test Summary: 73479 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6693
-
Markus Klein commented on patch set 7 10/20/20, 13:36
Published edit on patch set 6. -
TYPO3com voted on patch set 7 V +1 10/20/20, 13:50 Completed build in 13m 37s on Tue, 20 Oct, 01:50 PM Test Summary: 73479 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6695
-
Alexander Schnitzler uploaded patch set 8 10/23/20, 15:03
-
TYPO3com voted on patch set 8 V +1 10/23/20, 15:18 Completed build in 13m 59s on Fri, 23 Oct, 03:18 PM Test Summary: 73458 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6852
-
Daniel Haupt voted on patch set 8 V +1 CR +1 10/24/20, 10:11
-
Markus Klein voted on patch set 8 V +1 CR +1 10/27/20, 11:35
-
Benni Mack commented on patch set 8 11/04/20, 12:44
I don't see it breaking, as the class is marked as internal. But moving the RST to an "important" would be good! -
Markus Klein commented on patch set 8 V -1 CR -1 11/04/20, 13:14
alright. on it -
Christian Kuhn commented on patch set 8 11/04/20, 13:32
EnvironmentService.php:87Should we maybe just drop the initialize() method together with the $isFrontendMode property so this class is no longer "cached"? This way, the public reset() could be dropped and we'd have one statefull static class less. The constant comparison is not expensive, there will be zero difference between access to the property and access plus value comparison to the constant. Imho, there is simply no point in this "cache". -
Markus Klein uploaded patch set 9 11/04/20, 13:47
-
Markus Klein commented on patch set 9 11/04/20, 13:57
EnvironmentService.php:87ReplyWell, we have several situations where we need to fake the context within another context. Typically BE module needs to fake FE. So a dedicated setter could be helpful, because a constant can't be manipulated. I would need to dig into our older extensions, but I am pretty sure we have done that at least once. -
Benni Mack commented on patch set 9 11/04/20, 13:58
EnvironmentService.php:87ReplyI added the internal methods only because I needed them for testing purposes. -
TYPO3com voted on patch set 9 V +1 11/04/20, 13:59 Completed build in 11m 17s on Wed, 4 Nov, 01:59 PM Test Summary: 73585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7113
-
Alexander Schnitzler commented on patch set 9 11/04/20, 14:02
EnvironmentService.php:87ReplyAs Markus said, this class needs to be able to fake environments. In fact, I introduced this class years ago to be able to avoid checking constants directly and have the ability to test frontend behaviour in tests which are by default in the backend context. Also, I talked to Benni about this patch this morning and we would like to have move this class into the core and deprecate this extbase service. -
Markus Klein commented on patch set 9 11/04/20, 14:05
EnvironmentService.php:87Reply> we would like to have move this class into the core and deprecate this extbase service. should we do that with this patch right away? -
Alexander Schnitzler commented on patch set 9 11/04/20, 14:24
EnvironmentService.php:87Reply UnresolvedYes, we accidently discussed this behind the scenes the same moment you decided to rebase. -
Alexander Schnitzler uploaded patch set 10 11/04/20, 15:16
-
TYPO3com voted on patch set 10 V -1 11/04/20, 15:16 Completed build in 27s on Wed, 4 Nov, 03:16 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7114
-
Alexander Schnitzler commented on patch set 10 CR -1 11/04/20, 15:19
Typo3DbQueryParserTest.php:21This has to be removed. -
Alexander Schnitzler uploaded patch set 11 11/04/20, 15:23
-
Alexander Schnitzler commented on patch set 11 11/04/20, 15:24
Typo3DbQueryParserTest.php:21ReplyDone -
TYPO3com voted on patch set 11 V +1 11/04/20, 15:35 Completed build in 11m 56s on Wed, 4 Nov, 03:35 PM Test Summary: 73585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7115
-
Alexander Schnitzler commented on patch set 11 11/04/20, 15:45
I am opening this for review again despite not having a proper commit message. This is because I would like to put the class name for discussion. Also, I would like to discuss if we should make the new class api or leave it internal as is. IMHO people shouldn't rely on that class until we have a fully fletched solution for all those constants. -
Christian Kuhn commented on patch set 11 11/04/20, 20:18
Ok, here is the thing: TYPO3_MODE and TYPO3_REQUEST_TYPE are doomed. They are defined as constants. However, "mode" is NOT constant: This approach fails as soon as you want to do a 'sub request' to a FE from a BE or CLI call. This also means that "caching" this object in a singleton or in a static class is doomed since it needs a reset if changing context. TYPO3_MODE constant must completely fall since it is a 'one-time-per process' thing. The information if we are in frontend / backend / elsewhere can only be determined by the application class: The FrontendApplication / BackendApplication / ... classes *know* where we are. That's what they are for. Have a look at patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/65514 - this one binds the information if we're FE or BE to $request. A first patch from me (franzke's version is better) added it to the application object directly and enabled access of this information via container. The only drawback of this solution is that the information if we're FE/BE/whatever is NOT available during ext_localconf, because these files are parsed before Application is set up. Thus, my goal is to abandon TYPO3_MODE related calls from within early bootstrap calls like ext_localconf (ext_tables is ok since that is loaded *after* Application*). The ultimate goal on this is to allow proper sub requests "do a FE call from within CLI" and "FE call from within BE" and similar. Everything that relies on the constant TYPO3_MODE (or cache information derived from that constant) gives additional headaches. Maybe, we could have a closer look at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65514 and see if that one could make it? It would give a relative straight access to the "mode" by calling $GLOBALS['request'] at places where the request object is not available directly, as long as it is not called from within ext_localconf. What do you think? Do you follow my concerns on why I think that "mode" should be bound to the Application class in some way, and to refactor our code in a way that ext_localconf does not rely on "mode" since it is called before Application object is set up? Not being able to fire a FE request from within BE is a huge and long standing issue in the framework and I strive to solve that mid-term. Having that solved would give us major benefits, so my goal is to not introduce new constructs that rely on "mode" in a constant or singleton oriented way ... -
Christian Kuhn commented on patch set 11 11/04/20, 20:23
As a note, it seems there are various requirements on code that relies on TYPO3_MODE and looking at the patches, it seems we agree that we finally need a better abstraction to this. Maybe it is more easy if we ave a small chat with all persons willing to improve the situation to see how a good and sustainable solution could look like? -
Alexander Schnitzler commented on patch set 11 11/05/20, 06:44
I agree with everything that is said here and my goal is also to be able to dispatch sub-requests without side effects. My initial goal however was to get rid of a service in Extbase which is injected into prototypes just to have access to TYPO3_MODE, not a constant in its actual sense but a static value during the current request. I need this done to be able to deprecate Extbase DI quite early in 11 without having the core use it itself. That's only possible if I have a clear distinction between prototype and service objects. The only problem I have is the following: I try to solve a very specific issue and then people come by, talk about the big picture (which I agree on), and by that block my approach until there is something in place sometime in the future. You say you have a different approach and I am glad you have because often people block things in favor of just ideas. I am willing to help solve this problem of TYPO3_MODE in general if we actually make progress there within the next weeks. Pardon me but I am hearing about the removal of TYPO3_MODE for years now and I am just trying to find pragmatic solutions in the Extbase area until there is a solution I can rely on. :) -
Christian Kuhn commented on patch set 11 11/05/20, 09:23
This sounds good Alex. I'm willing to spend some private time on the TYPO3_MODE removal. Are you in for a talk on this to align on a strategy? Maybe we finally end up with a couple of patches to finally solve that topic :) -
Christian Kuhn uploaded patch set 12 12/02/20, 09:34
-
TYPO3com voted on patch set 12 V -1 12/02/20, 09:45 Completed build in 10m 53s on Wed, 2 Dec, 09:45 AM Test Summary: 15 of 32646 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7741
-
Christian Kuhn uploaded patch set 13 12/02/20, 11:00
-
TYPO3com voted on patch set 13 V +1 12/02/20, 11:10 Completed build in 10m 08s on Wed, 2 Dec, 11:10 AM Test Summary: 32405 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7743
-
Christian Kuhn uploaded patch set 14 04/29/21, 10:28
-
Christian Kuhn commented on patch set 14 04/29/21, 10:28
rebased for now. -
core-ci voted on patch set 14 V -1 04/29/21, 10:31 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10884
-
Christian Kuhn uploaded patch set 15 04/29/21, 10:56
-
core-ci voted on patch set 15 V -1 04/29/21, 11:11 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10886
-
Christian Kuhn uploaded patch set 16 04/29/21, 11:42
-
core-ci voted on patch set 16 V +1 04/29/21, 11:56 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10891
-
Christian Kuhn uploaded patch set 17 04/29/21, 13:05
-
Christian Kuhn updated the commit message in patch set 18 04/29/21, 13:10
-
core-ci voted on patch set 17 V +1 04/29/21, 13:17 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10899
-
core-ci voted on patch set 18 V +1 04/29/21, 13:22 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10901
-
Christian Kuhn uploaded patch set 19 04/29/21, 14:21
-
core-ci voted on patch set 19 V +1 04/29/21, 14:32 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10907
-
Markus Klein commented on patch set 19 04/29/21, 19:42
UriBuilder.php:615We actually have a real world usecase where we have to inject a modified EnvironmentService into this class. (note: we are still v8 in this project, but I'm pretty sure we will still need this in v10) We use a DataHandler hook, which needs to send out emails. The mails use Fluid rendering and hence parts of the extbase stack apply. Since the hook is executed in BE mode, we need to fake the EnvironmentService here to get proper links inside the mails (for FE). So if I read this correctly, from v11 on we need to fake the full TYPO3_REQUEST, right? -
Christian Kuhn commented on patch set 19 04/29/21, 22:42
UriBuilder.php:615Reply Unresolvedyeah. modify the request and set it as new global ... i *hope* we continue with the PSR-7 implementation in extbase in v11 so the psr-7 compatible request is carried around directly instead / in addition / in a merged variant of the extbase one. if so, you'd later pump your prepared request into your whatever controller and are good to go. -
Benni Mack uploaded patch set 20 05/01/21, 10:53
-
Benni Mack uploaded patch set 21 05/01/21, 10:54
-
Christian Kuhn voted on patch set 21 V +1 CR +1 05/01/21, 10:57
-
core-ci voted on patch set 20 V +1 05/01/21, 11:04 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11002
-
core-ci voted on patch set 21 V +1 05/01/21, 11:06 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11003
-
Benni Mack voted on patch set 21 V +2 CR +2 05/01/21, 11:35
-
Benni Mack merged patch set 22 05/01/21, 11:35