Review main Abandoned

85798[WIP][TASK] Inject `ResourceFactory` into `ResourceStorage`

Stefan Bürk CR 0 V -1 Easy +14 −13 updated 09/14/26, 20:20

Commit message

-----------------------------------------------------------
Brainfuck - having now a dependency injection cycle

    ResourceFactory -> StorageRepository
    StorageRepository -> ResourceFactory

because `ResourceStorage` instantiated manually within the
StorageRepository requires the ResourceFactory instance to
executed cross storage handling code.

Needs a solution for the fuckup to disband the (hidden)
cycling dependency chain
-----------------------------------------------------------

`ResourceStorage` needs to use `ResourceFactory` for some
operations and thus using `GeneralUtility::makeInstance()`
to retrieve the shared factory instance.

Usually a `ResourceStorage` instance is created by the
`StorageRepository` which is already DI aware and get
services injected.

This change modifies the `ResourceStorage` constructor to
allow injection of the `ResourceFactory` with fallback to
`GeneralUtility::makeInstance()` for now if a instance is
created manualy by 3rd party code. The `StorageRepository`
now also gets the `ResourceFactory` injected and uses it
to create `ResourceStorage` instances.

Note that `ResourceStorage` provides the public method
`getResourceFactoryInstance()` and must thus be taken
as public API which is not an issue here as we provide
the injected ResourceFactory instead.

Related test are aligned to inject the resource factory
if necessary.

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Files 5

Review log 34

  1. Stefan Bürk uploaded patch set 1 08/27/24, 17:22

  2. core-ci voted on patch set 1 V -1 08/27/24, 17:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64343

  3. Benni Mack marked it work in progress 03/23/25, 22:16

  4. Benni Mack abandoned the change 09/14/26, 20:20

    wont be needed anymore