[TASK] Instantiate Context through dependency injection
Context is stateful as Aspects dependent on the (currently dispatched) request type (frontend/backend/installtool/CLI). Reqest-dependent arguments can not be injected during service creation; therefore the Context class is now created without default aspects and enhanced by the application classes (on demand). Note: The UserAspect constructor is adapted to use an explicit stdClass allocation instead of an immutable array casted to an object for the (fallback) pseudo user. This is to avoid php segmentation faults in functional tests (and also random unit test runs). The segmentation faults would be triggered due to the constructor change in the Context class, which now uses ondemand instead of preemptive Aspect creation. Background: immutable arrays are stored on stack. The cast to an object probably didn't relocate this memory to the heap which then causes segmentations faults when the static memory area (on stack) is exceeded. Releases: master Resolves: #88793 Change-Id: Ib165f85b66b34e8025e28ef483260463f1e2c826 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Susanne Moog <look@susi.dev> Tested-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by:
Susanne Moog <look@susi.dev> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de>
Showing
- typo3/sysext/backend/Classes/Http/Application.php 12 additions, 15 deletionstypo3/sysext/backend/Classes/Http/Application.php
- typo3/sysext/backend/Classes/ServiceProvider.php 6 additions, 1 deletiontypo3/sysext/backend/Classes/ServiceProvider.php
- typo3/sysext/core/Classes/Console/CommandApplication.php 12 additions, 9 deletionstypo3/sysext/core/Classes/Console/CommandApplication.php
- typo3/sysext/core/Classes/Context/Context.php 41 additions, 26 deletionstypo3/sysext/core/Classes/Context/Context.php
- typo3/sysext/core/Classes/Context/UserAspect.php 11 additions, 1 deletiontypo3/sysext/core/Classes/Context/UserAspect.php
- typo3/sysext/core/Classes/ServiceProvider.php 7 additions, 1 deletiontypo3/sysext/core/Classes/ServiceProvider.php
- typo3/sysext/frontend/Classes/Http/Application.php 15 additions, 18 deletionstypo3/sysext/frontend/Classes/Http/Application.php
- typo3/sysext/frontend/Classes/ServiceProvider.php 6 additions, 1 deletiontypo3/sysext/frontend/Classes/ServiceProvider.php
- typo3/sysext/install/Classes/Http/Application.php 13 additions, 16 deletionstypo3/sysext/install/Classes/Http/Application.php
- typo3/sysext/install/Classes/ServiceProvider.php 2 additions, 1 deletiontypo3/sysext/install/Classes/ServiceProvider.php
Please register or sign in to comment