Skip to content

[TASK] Refactor ConfigurationManager#4558

Draft
sfroemkenjw wants to merge 1 commit intoTYPO3-Solr:mainfrom
jweiland-net:sfRefactorConfigurationManager
Draft

[TASK] Refactor ConfigurationManager#4558
sfroemkenjw wants to merge 1 commit intoTYPO3-Solr:mainfrom
jweiland-net:sfRefactorConfigurationManager

Conversation

@sfroemkenjw
Copy link
Copy Markdown
Collaborator

  • Add dependency injection for SiteFinder
  • Cleanup methods for better readability & reuse

* Add dependency injection for SiteFinder
* Cleanup methods for better readability & reuse
* Configuration manager that holds the configuration instance.
*/
class ConfigurationManager implements SingletonInterface
readonly class ConfigurationManager implements SingletonInterface
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can register the ConfigurationManager class in the Services.yaml file, to auto configure, make it public + shared, then you can

  1. Remove the SingletonInterface
  2. make CPP and remove the ?? GeneralUtility::makeInstance(SiteFinder)

@froemken
Copy link
Copy Markdown
Contributor

froemken commented Mar 8, 2026

I think I might have been a bit too hasty with this PR. The ConfigurationManager is a very central part of the system, and I’ve run into some significant challenges during the refactoring.

The main issue is that this class is frequently instantiated using GeneralUtility::makeInstance() without any parameters. Adding dependencies to the constructor causes breaks in numerous places, especially within our Unit Tests. When I try to inject classes like the SiteFinder or a FrontendInterface, these dependencies cannot be easily resolved in a Unit Test environment.

Furthermore, some methods contain logic branches where one part is testable via Unit Tests, but the other part strictly requires a Functional Test approach due to its dependencies. This makes working on this specific file quite difficult at the moment.

My plan now is to first migrate less critical classes from Unit to Functional tests, unless a Unit Test can truly isolate the class without recursive calls. Once the testing foundation is more robust, I will revisit this refactor.

@dkd-kaehm dkd-kaehm marked this pull request as draft March 9, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants