Review main Merged

57104[FEATURE] Add Contexts for storing data access modes

Benni Mack CR +2 V +2 Nightmare +2286 −264 updated 07/02/18, 09:01

Commit message

A new "Context" concept is added which allows to keep
the state of common TYPO3 Request Data in form of
so-called Aspects.

An aspect contains properties which can be fetched,
but only the ones that are really necessary, instead of
exposing a full object (e.g. BE_USER).

The main goal is to centralize some global variables
distributed in various places.

In the first step the following variables are considered:

- $TSFE->showHiddenPages
- $TSFE->showHiddenRecords
- $TSFE->beUserLogin
- $TSFE->gr_list
- $TSFE->loginUser
- $GLOBALS[SIM_EXEC_TIME]
- $GLOBALS['BE_USER']->workspace

For now the Context is a singleton object, but should
be fetched from a DI container.

Sometimes a custom context is necessary, so it is
cloned (see usage in TSFE).

The difference to the PSR-7 request attributes is that the
context is ONLY related to data access (like permissions / visibility)
and also independent if TYPO3 is running via HTTP or CLI
(thus, can be used in CLI mode as well).

Next Steps:
- Migrate PageRepository->versioningWorkspaceId
- Migrate TSFE->simUserGroup
- Use DateTimeAspect everywhere
- Introduce Language + Page Aspects
- Introduce the context object into ContentObjectRenderer and cObjects
- Use Contexts in RestrictionContainers
- Use Contexts in TYPO3 Backend
- Decouple sys_page behaviour from TSFE where applicable
- Ensure TypoScript conditions continue to work / have a documented alternative

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 52

Show 32 more files