Review main Merged Breaking

94930[!!!][FEATURE] Register text extractors as tagged services

Benni Mack CR +2 V +2 Hard +578 −121 updated 08/05/26, 08:33

Commit message

Text extractors are now registered as tagged services via the new
PHP attribute #[AsTextExtractor] (or the service tag
"fal.text_extractor") instead of the programmatic registration
through TextExtractorRegistry->registerTextExtractor() in
ext_localconf.php. The extractor priority is defined at
registration time via the attribute, extractors with a higher
priority are asked first whether they can extract text from a
given file.

The registration is resolved once at container compile time
instead of executing registration code on every request: loading
and validating the extractor classes per request as well as
instantiating them at runtime is gone, the compiled container
provides a pre-sorted lazy iterator. Extractors become proper
services with constructor injection, their order no longer
depends on the ext_localconf.php loading order, and the new
TextExtractorPass validates at compile time that every tagged
service implements TextExtractorInterface, failing the container
build instead of erroring at extraction time.

This comes with the following breaking changes:

* TextExtractorRegistry->registerTextExtractor() is now a no-op
  and will be removed in TYPO3 v16.0.
* The methods of TextExtractorInterface are now strictly typed.
* createTextExtractorInstance() has been removed from
  TextExtractorRegistry and getTextExtractorInstances() is
  protected. The public API of the registry remains
  getTextExtractor(), returning the first matching extractor
  for a given file.

Review

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

Issues 1

Files 19

Review log 1723

  1. Benni Mack uploaded patch set 1 07/24/26, 14:43

  2. core-ci voted on patch set 1 V +1 07/24/26, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105331

  3. Benni Mack uploaded patch set 2 V +1 07/24/26, 19:10

  4. Benni Mack marked it ready for review 07/24/26, 19:10

  5. core-ci voted on patch set 2 V +1 07/24/26, 19:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105350

  6. Stefan Bürk commented on patch set 2 07/25/26, 14:09

    Nice to see this movement going on. Thanks ❤️. Only some minor things.

    TextExtractorPass.php:29

    ```suggestion final readonly class TextExtractorPass implements CompilerPassInterface ```

    TextExtractorPass.php:31

    ```suggestion public function __construct(private string $tagName) {} ```

    TextExtractorRegistry.php:30

    Would it be possible to drop the `SingletonInterface` directly as we are already changing the whole class ? ```suggestion #[Autowire(public: true) class TextExtractorRegistry ```

    TextExtractorRegistry.php:42

    ```suggestion public function __construct( #[TaggedIterator('fal.text_extractor')] protected readonly iterable $textExtractors = [], ) {} ``` Let's use PHP attribute here over `Services.yaml` usage.

    Services.yaml:30

    Can we start using `phpattributes` over `Services.yaml` for new stuff and doing this tagget iterator on the registry construtor class ? (Removing it here again). I'll comment it also for the constructor.
  7. Benni Mack commented on patch set 3 V +1 07/27/26, 14:50

    Published edit on patch set 2.
  8. Benni Mack commented on patch set 4 07/27/26, 14:51

    Published edit on patch set 3.
  9. Benni Mack commented on patch set 4 07/27/26, 14:51

    TextExtractorPass.php:29 Reply

    Fix applied.

    TextExtractorPass.php:31 Reply

    Fix applied.

    TextExtractorRegistry.php:30 Reply

    Fix applied.

    TextExtractorRegistry.php:30 Reply

    Fix applied.

    TextExtractorRegistry.php:42 Reply

    Fix applied.

    Services.yaml:30 Reply

    Done
  10. core-ci voted on patch set 4 V -1 07/27/26, 15:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105471

  11. core-ci voted on patch set 3 V -1 07/27/26, 15:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105470

  12. Benni Mack uploaded patch set 5 V -1 07/27/26, 16:32

  13. core-ci voted on patch set 5 V +1 07/27/26, 16:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105488

  14. Benni Mack marked it ready for review 07/27/26, 19:17

  15. Benni Mack commented on patch set 5 07/27/26, 19:18

    Services.yaml:30 Reply

    Id first like to migrate all parts, and then centralize all of them once / separately.
  16. Benni Mack rebased onto patch set 6 V +1 07/31/26, 08:25

  17. core-ci voted on patch set 6 V +1 07/31/26, 08:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105745

  18. Stefan Bürk voted on patch set 6 CR +1 V +1 08/01/26, 09:56

  19. Stefan Bürk commented on patch set 6 08/01/26, 09:56

    Services.yaml:30 Reply

    Ack.
  20. Maike Kiebele voted on patch set 6 V +1 08/03/26, 06:45

  21. Oliver Klee voted on patch set 6 V +1 08/03/26, 09:20

  22. Georg Ringer voted on patch set 6 CR +2 V +2 08/05/26, 08:33

  23. Georg Ringer merged patch set 7 08/05/26, 08:33