Task #88793

Epic #83968: PSR-11 Initiative

Configure dependency injection for Core/Context class

Added by Benjamin Franzke about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Start date:
2019-07-18
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

Associated revisions

Revision 03543ce3 (diff)
Added by Benjamin Franzke about 1 month ago

[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 <>
Tested-by: Susanne Moog <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274

#2 Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274

#3 Updated by Gerrit Code Review about 1 month ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274

#4 Updated by Gerrit Code Review about 1 month ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274

#5 Updated by Gerrit Code Review about 1 month ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61274

#6 Updated by Benjamin Franzke about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF