Review main Merged

93657[BUGFIX] Introduce `PackageSetup` to unify extension setup

Helmut Hummel CR +2 V +2 Normal +141 −104 updated 04/16/26, 07:25

Commit message

Package setup logic was spread across several places, which led to
inconsistencies and hard-to-follow responsibilities.

This change introduces a dedicated PackageSetup that centralizes the
common steps required when extensions are set up:

* updating the database schema
* synchronizing extension configuration
* dispatching PackageInitializationEvent
* collecting warnings from initialization listeners

This unifies the behavior of extension:setup,
classic-mode package activation, and extension manager actions.

As part of this refactoring, SetupExtensionsCommand now delegates to
`PackageSetup` instead of partially duplicating setup logic.

PackageActivationService is reduced to its actual responsibility:
handling package activation in classic mode, including the required
container rebuild and TCA reinitialization. The setup work that happens
after activation is now delegated to `PackageSetup`.

The former public method `PackageActivationService::updateDatabase()`
is removed. Its implementation depended on a specific container/global
state and was used from different contexts with different runtime
assumptions. Moving this logic into `PackageSetup` makes the
flow explicit and keeps it in the place where extension setup is
actually performed.

The extension manager action for reloading extension data is adjusted
accordingly. Since it only needed a small, specific part of the old
behavior, the registry cleanup is now handled directly there before
delegating to `PackageSetup`.

This results in cleaner responsibilities, less duplicated setup logic,
and more consistent extension initialization behavior across the codebase.

Although public methods have been removed from
`PackageActivationService`, this change is not considered breaking, as
the class is marked internal.

Commands executed:

```
Build/Scripts/runTests.sh -s phpstanGenerateBaseline
```

Review

  • Code review CR +2 Done
    • Helmut Hummel +2
    • Nicole Hummel +1
    • Benni Mack +1
  • Verified V +2 Done
    • Helmut Hummel +2
    • Oliver Klee +1
    • Nicole Hummel +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 2533

Show 58 earlier messages
  1. Helmut Hummel uploaded patch set 1 04/14/26, 10:10

  2. Helmut Hummel uploaded patch set 2 04/14/26, 10:36

  3. core-ci voted on patch set 1 V -1 04/14/26, 10:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100133

  4. Helmut Hummel rebased onto patch set 3 04/14/26, 11:04

  5. core-ci voted on patch set 2 V -1 04/14/26, 11:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100139

  6. core-ci voted on patch set 3 V -1 04/14/26, 11:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100148

  7. Helmut Hummel uploaded patch set 4 V -1 04/14/26, 12:45

  8. Simon Schaufelberger commented on patch set 4 04/14/26, 12:49

    I would call it a TASK
  1. Helmut Hummel commented on patch set 4 04/14/26, 12:51

    Reply

    hm, it actually fixes a bug.
  2. core-ci voted on patch set 4 V +1 04/14/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100155

  3. Simon Schaufelberger commented on patch set 4 04/14/26, 12:54

    Reply

    ok but that is not clear from the title.
  4. Helmut Hummel commented on patch set 4 04/14/26, 17:15

    Reply

    feel free to suggest a better title. I fixed the bug by doing what is mentioned in the title.
  5. Helmut Hummel updated the commit message in patch set 5 V +1 04/14/26, 17:16

  6. core-ci voted on patch set 5 V +1 04/14/26, 17:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100179

  7. Benni Mack commented on patch set 5 CR +1 V +1 04/14/26, 20:46

    SetupExtensionsService.php:16

    I would put this into TYPO3\CMS\Core\Core or TYPO3\CMS\Core\Package, but does not matter here.
  8. Helmut Hummel rebased onto patch set 6 CR +1 V +1 04/14/26, 21:39

  9. Helmut Hummel commented on patch set 6 04/14/26, 21:41

    SetupExtensionsService.php:16 Reply

    put it in Package and call it PackageSetupService?
  10. core-ci voted on patch set 6 V +1 04/14/26, 22:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100205

  11. Mathias Brodala commented on patch set 6 04/15/26, 04:51

    "ExtensionSetupService" would be a better order of terms. Or even just "ExtensionSetup", no need to call it "service".
  12. Helmut Hummel commented on patch set 6 04/15/26, 05:10

    Reply

    I agree. I also like to skip the service suffix. However i'm typo3 there are more services with suffix than not
  13. Benni Mack commented on patch set 6 04/15/26, 05:41

    SetupExtensionsService.php:16 Reply

    yes. Or -- as discussed above just "Package\PackageSetup" then.
  14. Helmut Hummel uploaded patch set 7 V +1 04/15/26, 10:53

  15. Helmut Hummel commented on patch set 7 04/15/26, 10:54

    Reply

    Done

    Reply

    Done

    SetupExtensionsService.php:16 Reply

    Done
  16. core-ci voted on patch set 7 V +1 04/15/26, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100245

  17. Mathias Brodala commented on patch set 7 04/15/26, 11:10

    "PackageSetup" class
  18. Oliver Klee updated the commit message in patch set 8 V +1 04/15/26, 12:17

  19. Oliver Klee commented on patch set 8 04/15/26, 12:17

    Reply

    Done
  20. core-ci voted on patch set 8 V +1 04/15/26, 12:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100249

  21. Benni Mack voted on patch set 8 CR +1 V +1 04/15/26, 12:34

  22. Oliver Klee voted on patch set 8 V +1 04/15/26, 14:06

  23. Nicole Hummel voted on patch set 8 CR +1 V +1 04/16/26, 07:24

  24. Helmut Hummel voted on patch set 8 CR +2 V +2 04/16/26, 07:25

  25. Helmut Hummel merged patch set 9 04/16/26, 07:25