I want to replace my old signal registration through a PSR-14 event listener registration. So I have removed the following from my ext_localconf.php:
ext_localconf.php
...
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
'afterExtensionInstall',
\My\Example\Slots\InstallUtility::class,
'afterExtensionInstall'
);
...
Furthermore, I have created the following file:
Configuration/Services.yaml
services:
My\Example\Slots\InstallUtility:
tags:
- name: event.listener
identifier: 'afterExtensionInstall'
event: TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent
After that I have added an invoke function to My\Example\Slots\InstallUtility:
namespace My\Example\Slots;
use TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent;
class InstallUtility
{
/**
* @param AfterPackageActivationEvent $event
*/
public function __invoke(AfterPackageActivationEvent $event): void
{
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump('event got triggered'); die();
}
...
}
But this is not working. If deactivate my extension via extension manager and then reactivate it again, nothing happens.
Did I miss something here?