Feature: #95089 - New PSR-14 AfterFileCommandProcessedEvent¶
See forge#95089
Description¶
A new PSR-14 event \TYPO3\
has been added to TYPO3 Core. This event is fired in the
\TYPO3\
class and allows extensions to execute additional tasks, after a file
operation has been performed.
The event features the following methods:
get
: Returns the command array while the array key is the performed action and the value is the command data ("cmdArr")Command () get
: Returns the operation result, which could e.g. be an uploaded or changedResult () File
or aboolean
for the "delete" actionget
: The conflict mode for the performed operation, e.g. "rename" or "cancel"Conflict Mode ()
Registration of the Event in your extensions' Services.
:
MyVendor\MyPackage\File\MyEventListener:
tags:
- name: event.listener
identifier: 'my-package/file/my-event-listener'
Copied!
The corresponding event listener class:
use TYPO3\CMS\Core\Resource\Event\AfterFileCommandProcessedEvent;
class MyEventListener {
public function __invoke(AfterFileCommandProcessedEvent $event): void
{
// do magic here
}
}
Copied!
Impact¶
This event can be used to perform additional tasks for specific file commands. For example, trigger a custom indexer after a file has been uploaded.