Skip to content
Snippets Groups Projects
Commit 41e3abe8 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Modernize condition matching

The TypoScript condition matching and our symfony
expression language handling is a heavily convoluted
mess: The entire API tends to fetch lots of global
state, the classes are complex, hard to understand and
handle, over-abstracted and full of anti-patterns.

The patch aims to mitigate this. The main strategy is
to provide relevant data from within callers directly
instead of fetching globals TYPO3_REQUEST, calling
GeneralUtility::_GP() and GeneralUtility::getIndpEnv().

* For TypoScript 'condition' expression handler usages,
  the frontend/backend related ConditionMatcher classes
  are obsoleted. The IncludeTreeConditionMatcherVisitor
  class within the new TypoScript parser is now the
  construct that prepares TypoScript relevant variables
  to initialize the symfony expression language construct,
  and gets variables actively hand over.

* The default provider now prepares variables from state
  that can be injected, the entire ProviderInterface no
  longer relies on runtime state from globals.

* Access to runtime Request object is streamlined:
  Especially PageTsConfig and UserTsConfig can not rely
  on a given request object since the DataHandler uses
  this a well, which denies systematic usage of request
  related data. This is deprecated.

* The ProviderInterface config handling should still be
  streamlined towards a symfony service provider approach.
  The current solution is kept for now, an @todo is added
  to briefly outline on how this should be changed in v13
  as a breaking change.

* Note this patch avoids the last core usage of
  GeneralUtility::_GP() which will be deprecated with
  another patch. Additionally, a hard to fix call to
  GeneralUtility::getIndpEnv() is avoided.

Change-Id: I476b69776e950a5a7e5ed937d2e2c58fe00f133f
Resolves: #100047
Related: #97816
Releases: main
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77981


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 14dbdec5
Branches
Tags
No related merge requests found
Showing
with 488 additions and 226 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment