Review main Merged

95207[TASK] Promote psr/clock to an explicit core dependency

Benni Mack CR +2 V +2 Normal +203 −16 updated 08/10/26, 21:10

Commit message

The PSR-20 clock interface has been shipped as a transitive
dependency already and is now required explicitly, together with
two implementations:

* SystemClock returns the actual current time on every call and
  is the default implementation received when injecting
  Psr\Clock\ClockInterface. Use it whenever the real wall-clock
  time matters, such as expiry of sessions or tokens - especially
  in long-running CLI processes, where a timestamp taken at
  process start goes stale.

* RequestClock is frozen at request start (the instant known as
  $GLOBALS['EXEC_TIME']) and returns the same instant on every
  call. Inject the concrete RequestClock class when multiple
  reads within one request must yield a consistent "time of the
  current request". For the simulated time of a request (e.g.
  admin panel preview), the Context API "date" aspect remains
  the designated source.

The RequestClock instance is created during TYPO3 bootstrap and
handed to the dependency injection container as an early
instance, just like the RequestId - one frozen instant per
request in web server contexts, one per application run on CLI.

UserSessionManager now accepts a clock instead of reading
$GLOBALS['EXEC_TIME'] and deliberately uses the advancing
SystemClock: session lifetimes exceed in-request drift by
magnitudes, and long-running CLI processes now compare against
the actual time instead of the stale process start time.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 69

  1. Benni Mack uploaded patch set 1 08/10/26, 13:43

  2. core-ci voted on patch set 1 V +1 08/10/26, 13:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106288

  3. Benni Mack uploaded patch set 2 V +1 08/10/26, 13:58

  4. core-ci voted on patch set 2 V +1 08/10/26, 14:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106289

  5. Benni Mack uploaded patch set 3 V +1 08/10/26, 14:36

  6. core-ci voted on patch set 3 V +1 08/10/26, 14:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106290

  7. Oliver Klee voted on patch set 3 CR +1 V +1 08/10/26, 15:19

  8. Stefan Bürk voted on patch set 3 CR +2 V +2 08/10/26, 20:16

  9. Stefan Bürk merged patch set 4 08/10/26, 21:10