• bfr's avatar
    [TASK] Instantiate Context through dependency injection · 03543ce3
    bfr authored and afernandez's avatar afernandez committed
    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: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: default avatarSusanne Moog <look@susi.dev>
    Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Reviewed-by: default avatarSusanne Moog <look@susi.dev>
    Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    03543ce3