sabbelasichon / typo3-rector

Rector for TYPO3
MIT License
231 stars 63 forks source link

Feature: #95065 - New PSR-14 BootCompletedEvent #4437

Closed simonschaufi closed 3 weeks ago

simonschaufi commented 3 weeks ago

Feature: #95065 - New PSR-14 BootCompletedEvent

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.4/Feature-95065-NewPSR-14BootCompletedEvent.html

Feature: #95065 - New PSR-14 BootCompletedEvent

See 95065

Description

A new PSR-14 event \TYPO3\CMS\Core\Core\Event\BootCompletedEvent has been added to TYPO3 Core. This event is fired on every request when TYPO3 has been fully booted, right after all configuration files have been added.

This new Event complements the \TYPO3\CMS\Core\Configuration\Event\AfterTcaCompilationEvent which is executed after TCA configuration has been assembled.

Registration of the Event in your extensions' Services.yaml:

MyVendor\MyPackage\Bootstrap\MyEventListener:
  tags:
    - name: event.listener
      identifier: 'my-package/my-listener'
class MyEventListener {
    public function __invoke(BootCompletedEvent $e): void
    {
        // do your magic
    }
}

Impact

Use cases for this event is to alter or to boot up extensions' code which needs to be executed at any time, and needs TYPO3's full configuration including all loaded extensions.

PHP-API, ext:core