TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:09 +02:00
commit af8cc155b5
6818 changed files with 642608 additions and 0 deletions
@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FolderInterface;
/**
* Event that is fired after the default upload folder for a user was checked
*/
final class AfterDefaultUploadFolderWasResolvedEvent
{
public function __construct(
private ?FolderInterface $uploadFolder,
private readonly ?int $pid,
private readonly ?string $table,
private readonly ?string $fieldName
) {}
public function getUploadFolder(): ?FolderInterface
{
return $this->uploadFolder;
}
public function setUploadFolder(FolderInterface $uploadFolder): void
{
$this->uploadFolder = $uploadFolder;
}
public function getPid(): ?int
{
return $this->pid;
}
public function getTable(): ?string
{
return $this->table;
}
public function getFieldName(): ?string
{
return $this->fieldName;
}
}
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired after a file was added to the Resource Storage / Driver.
*
* Use case: Using listeners for this event allows to e.g. post-check permissions or
* specific analysis of files like additional metadata analysis after adding them to TYPO3.
*/
final readonly class AfterFileAddedEvent
{
public function __construct(private FileInterface $file, private Folder $folder) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once an index was just added to the database (= indexed).
*
* Examples: Allows to additionally populate custom fields of the sys_file/sys_file_metadata database records.
*/
final readonly class AfterFileAddedToIndexEvent
{
public function __construct(private int $fileUid, private array $record) {}
public function getFileUid(): int
{
return $this->fileUid;
}
public function getRecord(): array
{
return $this->record;
}
}
@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* Event that is triggered after a file command has been processed. Can be used
* to perform additional tasks for specific commands. For example, trigger a
* custom indexer after a file has been uploaded.
*/
final readonly class AfterFileCommandProcessedEvent
{
public function __construct(
private array $command,
private mixed $result,
private string $conflictMode
) {}
/**
* A single command, e.g.
*
* ```
* 'upload' => [
* 'target' => '1:/some/folder/'
* 'data' => '1'
* ]
* ```
*
* @return array<string, array<string, mixed>>
*/
public function getCommand(): array
{
return $this->command;
}
/**
* @return mixed The result - Depending on the performed action,
* this could e.g. be a File or just a boolean.
*/
public function getResult(): mixed
{
return $this->result;
}
/**
* @return string The current conflict mode
* @see DuplicationBehavior
*/
public function getConflictMode(): string
{
return $this->conflictMode;
}
}
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired after the contents of a file got set / replaced.
*
* Examples: Listeners can analyze content for AI purposes within Extensions.
*/
final readonly class AfterFileContentsSetEvent
{
public function __construct(private FileInterface $file, private string $content) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getContent(): string
{
return $this->content;
}
}
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired after a file was copied within a Resource Storage / Driver.
* The folder represents the "target folder".
*
* Example: Listeners can sign up for listing duplicates using this event.
*/
final readonly class AfterFileCopiedEvent
{
public function __construct(
private FileInterface $file,
private Folder $folder,
private string $newFileIdentifier,
private ?FileInterface $newFile
) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getFolder(): Folder
{
return $this->folder;
}
public function getNewFileIdentifier(): string
{
return $this->newFileIdentifier;
}
public function getNewFile(): ?FileInterface
{
return $this->newFile;
}
}
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a file was created within a Resource Storage / Driver.
* The folder represents the "target folder".
*
* Example: This allows to modify a file or check for an appropriate signature after a file was created in TYPO3.
*/
final readonly class AfterFileCreatedEvent
{
public function __construct(private string $fileName, private Folder $folder) {}
public function getFileName(): string
{
return $this->fileName;
}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired after a file was deleted.
*
* Example: If an extension provides additional functionality (e.g. variants), this event allows listener to also clean
* up their custom handling. This can also be used for versioning of files.
*/
final readonly class AfterFileDeletedEvent
{
public function __construct(private FileInterface $file) {}
public function getFile(): FileInterface
{
return $this->file;
}
}
@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once a file was just marked as missing in the database (sys_file).
*
* Example: If a file is marked as missing, listeners can try to recover a file. This can happen on specific setups
* where editors also work via FTP.
*/
final readonly class AfterFileMarkedAsMissingEvent
{
public function __construct(private int $fileUid) {}
public function getFileUid(): int
{
return $this->fileUid;
}
}
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once metadata of a file was added to the database, so it can be
* enriched with more information.
*/
final class AfterFileMetaDataCreatedEvent
{
public function __construct(
private readonly int $fileUid,
private readonly int $metaDataUid,
private array $record
) {}
public function getFileUid(): int
{
return $this->fileUid;
}
public function getMetaDataUid(): int
{
return $this->metaDataUid;
}
public function getRecord(): array
{
return $this->record;
}
public function setRecord(array $record): void
{
$this->record = $record;
}
}
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once all metadata of a file was removed, in order to manage custom metadata that was
* added previously
*/
final readonly class AfterFileMetaDataDeletedEvent
{
public function __construct(private int $fileUid) {}
public function getFileUid(): int
{
return $this->fileUid;
}
}
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once metadata of a file was updated, in order to update custom metadata fields accordingly
*/
final readonly class AfterFileMetaDataUpdatedEvent
{
public function __construct(
private int $fileUid,
private int $metaDataUid,
private array $record
) {}
public function getFileUid(): int
{
return $this->fileUid;
}
public function getMetaDataUid(): int
{
return $this->metaDataUid;
}
public function getRecord(): array
{
return $this->record;
}
}
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\FolderInterface;
/**
* This event is fired after a file was moved within a Resource Storage / Driver.
* The folder represents the "target folder".
*
* Examples: Use this to update custom third party handlers that rely on specific paths.
*/
final readonly class AfterFileMovedEvent
{
public function __construct(
private FileInterface $file,
private Folder $folder,
private FolderInterface $originalFolder
) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getFolder(): Folder
{
return $this->folder;
}
public function getOriginalFolder(): FolderInterface
{
return $this->originalFolder;
}
}
@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\ProcessedFile;
/**
* This event is fired after a file object has been processed.
*
* This allows to further customize a file object's processed file.
*/
final class AfterFileProcessingEvent
{
public function __construct(
private readonly DriverInterface $driver,
private ProcessedFile $processedFile,
private readonly FileInterface $file,
private readonly string $taskType,
private readonly array $configuration
) {}
public function getProcessedFile(): ProcessedFile
{
return $this->processedFile;
}
public function setProcessedFile(ProcessedFile $processedFile): void
{
$this->processedFile = $processedFile;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
public function getFile(): FileInterface
{
return $this->file;
}
public function getTaskType(): string
{
return $this->taskType;
}
public function getConfiguration(): array
{
return $this->configuration;
}
}
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired once a file was just removed in the database (sys_file).
*
* Example can be to further handle files and manage them separately outside of TYPO3's index.
*/
final readonly class AfterFileRemovedFromIndexEvent
{
public function __construct(private int $fileUid) {}
public function getFileUid(): int
{
return $this->fileUid;
}
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired after a file was renamed in order to further process a file or filename
* or update custom references to a file.
*/
final readonly class AfterFileRenamedEvent
{
public function __construct(private FileInterface $file, private ?string $targetFileName) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getTargetFileName(): ?string
{
return $this->targetFileName;
}
}
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired after a file was replaced.
*
* Example: Further process a file or create variants, or index the contents of a file for AI analysis etc.
*/
final readonly class AfterFileReplacedEvent
{
public function __construct(private FileInterface $file, private string $localFilePath) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getLocalFilePath(): string
{
return $this->localFilePath;
}
}
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\File;
/**
* This event is fired once an index was just updated inside the database (= indexed).
* Custom listeners can update further index values when a file was updated.
*/
final readonly class AfterFileUpdatedInIndexEvent
{
public function __construct(
private File $file,
private array $properties,
private array $updatedFields
) {}
public function getFile(): File
{
return $this->file;
}
public function getRelevantProperties(): array
{
return $this->properties;
}
public function getUpdatedFields(): array
{
return $this->updatedFields;
}
}
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired after a folder was added to the Resource Storage / Driver.
*
* This allows to customize permissions or set up editor permissions automatically via listeners.
*/
final readonly class AfterFolderAddedEvent
{
public function __construct(private Folder $folder) {}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\FolderInterface;
/**
* This event is fired after a folder was copied to the Resource Storage / Driver.
*
* Example: Custom listeners can analyze contents of a file or add custom permissions to a folder automatically.
*/
final readonly class AfterFolderCopiedEvent
{
public function __construct(
private Folder $folder,
private Folder $targetParentFolder,
private ?FolderInterface $targetFolder
) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetParentFolder(): Folder
{
return $this->targetParentFolder;
}
public function getTargetFolder(): ?FolderInterface
{
return $this->targetFolder;
}
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired after a folder was deleted. Custom listeners can then further clean up permissions or
* third-party processed files with this event.
*/
final readonly class AfterFolderDeletedEvent
{
public function __construct(private Folder $folder, private bool $wasDeleted) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function isDeleted(): bool
{
return $this->wasDeleted;
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\FolderInterface;
/**
* This event is fired after a folder was moved within the Resource Storage / Driver.
*
* Custom references can be updated via listeners of this event.
*/
final readonly class AfterFolderMovedEvent
{
public function __construct(
private Folder $folder,
private Folder $targetParentFolder,
private ?FolderInterface $targetFolder
) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetParentFolder(): Folder
{
return $this->targetParentFolder;
}
public function getTargetFolder(): ?FolderInterface
{
return $this->targetFolder;
}
}
@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired after a folder was renamed.
*
* Examples: Add custom processing of folders or adjust permissions.
*/
final readonly class AfterFolderRenamedEvent
{
public function __construct(
private Folder $folder,
private Folder $sourceFolder
) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getSourceFolder(): Folder
{
return $this->sourceFolder;
}
}
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\ResourceStorage;
/**
* This event is fired after a resource object was built/created.
*
* Custom handlers can be initialized at this moment for any kind of source as well.
*/
final class AfterResourceStorageInitializationEvent
{
public function __construct(private ResourceStorage $storage) {}
public function getStorage(): ResourceStorage
{
return $this->storage;
}
public function setStorage(ResourceStorage $storage): void
{
$this->storage = $storage;
}
}
@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceStorage;
/**
* This event is fired before a file is about to be added to the Resource Storage / Driver.
*
* This allows to do custom checks to a file or restrict access to a file before the file is added.
*/
final class BeforeFileAddedEvent
{
public function __construct(
private string $fileName,
private readonly string $sourceFilePath,
private readonly Folder $targetFolder,
private readonly ResourceStorage $storage,
private readonly DriverInterface $driver
) {}
public function getFileName(): string
{
return $this->fileName;
}
public function setFileName(string $fileName): void
{
$this->fileName = $fileName;
}
public function getSourceFilePath(): string
{
return $this->sourceFilePath;
}
public function getTargetFolder(): Folder
{
return $this->targetFolder;
}
public function getStorage(): ResourceStorage
{
return $this->storage;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
}
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired before the contents of a file gets set / replaced.
*
* This allows to further analyze or modify the content of a file before it is written by the driver.
*/
final class BeforeFileContentsSetEvent
{
public function __construct(private readonly FileInterface $file, private string $content) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getContent(): string
{
return $this->content;
}
public function setContent(string $content): void
{
$this->content = $content;
}
}
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a file is about to be copied within a Resource Storage / Driver.
* The folder represents the "target folder".
*
* This allows to further analyze or modify the file or metadata before it is written by the driver.
*/
final readonly class BeforeFileCopiedEvent
{
public function __construct(private FileInterface $file, private Folder $folder) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a file is about to be created within a Resource Storage / Driver.
* The folder represents the "target folder".
*
* This allows to further analyze or modify the file or filename before it is written by the driver.
*/
final readonly class BeforeFileCreatedEvent
{
public function __construct(private string $fileName, private Folder $folder) {}
public function getFileName(): string
{
return $this->fileName;
}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired before a file is about to be deleted.
*
* Event listeners can clean up third-party references with this event.
*/
final readonly class BeforeFileDeletedEvent
{
public function __construct(private FileInterface $file) {}
public function getFile(): FileInterface
{
return $this->file;
}
}
@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a file is about to be moved within a Resource Storage / Driver.
* The folder represents the "target folder".
*/
final readonly class BeforeFileMovedEvent
{
public function __construct(
private FileInterface $file,
private Folder $folder,
private string $targetFileName
) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetFileName(): string
{
return $this->targetFileName;
}
}
@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\ProcessedFile;
/**
* This event is fired before a file object is processed.
*
* Allows to add further information or enrich the file before the processing is kicking in.
*/
final class BeforeFileProcessingEvent
{
public function __construct(
private readonly DriverInterface $driver,
private ProcessedFile $processedFile,
private readonly FileInterface $file,
private readonly string $taskType,
private readonly array $configuration
) {}
public function getProcessedFile(): ProcessedFile
{
return $this->processedFile;
}
public function setProcessedFile(ProcessedFile $processedFile): void
{
$this->processedFile = $processedFile;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
public function getFile(): FileInterface
{
return $this->file;
}
public function getTaskType(): string
{
return $this->taskType;
}
public function getConfiguration(): array
{
return $this->configuration;
}
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired before a file is about to be renamed. Custom listeners can further rename the file
* according to specific guidelines based on the project.
*/
final readonly class BeforeFileRenamedEvent
{
public function __construct(private FileInterface $file, private ?string $targetFileName) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getTargetFileName(): ?string
{
return $this->targetFileName;
}
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\FileInterface;
/**
* This event is fired before a file is about to be replaced.
* Custom listeners can check for file integrity or analyze the content of the file before it gets added.
*/
final readonly class BeforeFileReplacedEvent
{
public function __construct(private FileInterface $file, private string $localFilePath) {}
public function getFile(): FileInterface
{
return $this->file;
}
public function getLocalFilePath(): string
{
return $this->localFilePath;
}
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a folder is about to be added to the Resource Storage / Driver.
* This allows to further specify folder names according to regulations for a specific project.
*/
final readonly class BeforeFolderAddedEvent
{
public function __construct(private Folder $parentFolder, private string $folderName) {}
public function getParentFolder(): Folder
{
return $this->parentFolder;
}
public function getFolderName(): string
{
return $this->folderName;
}
}
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a folder is about to be copied to the Resource Storage / Driver.
* Listeners could add deferred processing / queuing of large folders.
*/
final readonly class BeforeFolderCopiedEvent
{
public function __construct(
private Folder $folder,
private Folder $targetParentFolder,
private string $targetFolderName
) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetParentFolder(): Folder
{
return $this->targetParentFolder;
}
public function getTargetFolderName(): string
{
return $this->targetFolderName;
}
}
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a folder is about to be deleted.
*
* Listeners can use this event to clean up further external references to a folder / files in this folder.
*/
final readonly class BeforeFolderDeletedEvent
{
public function __construct(private Folder $folder) {}
public function getFolder(): Folder
{
return $this->folder;
}
}
@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a folder is about to be moved to the Resource Storage / Driver.
* Listeners can be used to modify a folder name before it is actually moved or to ensure consistency
* or specific rules when moving folders.
*/
final readonly class BeforeFolderMovedEvent
{
public function __construct(
private Folder $folder,
private Folder $targetParentFolder,
private string $targetFolderName
) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetParentFolder(): Folder
{
return $this->targetParentFolder;
}
public function getTargetFolderName(): string
{
return $this->targetFolderName;
}
}
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Folder;
/**
* This event is fired before a folder is about to be renamed.
* Listeners can be used to modify a folder name before it is actually moved or to ensure consistency
* or specific rules when renaming folders.
*/
final readonly class BeforeFolderRenamedEvent
{
public function __construct(private Folder $folder, private string $targetName) {}
public function getFolder(): Folder
{
return $this->folder;
}
public function getTargetName(): string
{
return $this->targetName;
}
}
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* This event is fired before a resource object is actually built/created.
*
* Example: A database record can be enriched to add dynamic values to each resource (file/folder) before
* creation of a storage
*/
final class BeforeResourceStorageInitializationEvent
{
public function __construct(private $storageUid, private $record, private ?string $fileIdentifier) {}
public function getStorageUid(): int
{
return $this->storageUid;
}
public function setStorageUid(int $storageUid): void
{
$this->storageUid = $storageUid;
}
public function getRecord(): array
{
return $this->record;
}
public function setRecord(array $record): void
{
$this->record = $record;
}
public function getFileIdentifier(): ?string
{
return $this->fileIdentifier;
}
public function setFileIdentifier(?string $fileIdentifier): void
{
$this->fileIdentifier = $fileIdentifier;
}
}
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
/**
* Event that is called after a record has been loaded from database
* Allows other places to do extension of metadata at runtime or
* for example translation and workspace overlay.
*/
final class EnrichFileMetaDataEvent
{
public function __construct(private readonly int $fileUid, private readonly int $metaDataUid, private array $record) {}
public function getFileUid(): int
{
return $this->fileUid;
}
public function getMetaDataUid(): int
{
return $this->metaDataUid;
}
public function getRecord(): array
{
return $this->record;
}
public function setRecord(array $record): void
{
$this->record = $record;
}
}
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\ResourceInterface;
use TYPO3\CMS\Core\Resource\ResourceStorage;
/**
* This event is fired before TYPO3 FAL's native URL generation for a Resource is instantiated.
*
* This allows for listeners to create custom links to certain files (e.g. restrictions) for creating
* authorized deeplinks.
*/
final class GeneratePublicUrlForResourceEvent
{
private ?string $publicUrl = null;
public function __construct(
private readonly ResourceInterface $resource,
private readonly ResourceStorage $storage,
private readonly DriverInterface $driver
) {}
public function getResource(): ResourceInterface
{
return $this->resource;
}
public function getStorage(): ResourceStorage
{
return $this->storage;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
public function getPublicUrl(): ?string
{
return $this->publicUrl;
}
public function setPublicUrl(?string $publicUrl): void
{
$this->publicUrl = $publicUrl;
}
}
@@ -0,0 +1,69 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use Psr\EventDispatcher\StoppableEventInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Resource\ResourceInterface;
/**
* Event that is triggered when a file should be dumped to the browser, allowing to perform custom
* security/access checks when accessing a file through a direct link, and returning an alternative
* Response.
*
* It is also possible to replace the file during this event, but not setting a response.
*
* As soon as a custom Response is added, the propagation is stopped.
*/
final class ModifyFileDumpEvent implements StoppableEventInterface
{
private ?ResponseInterface $response = null;
public function __construct(private ResourceInterface $file, private ServerRequestInterface $request) {}
public function getFile(): ResourceInterface
{
return $this->file;
}
public function setFile(ResourceInterface $file): void
{
$this->file = $file;
}
public function getRequest(): ServerRequestInterface
{
return $this->request;
}
public function setResponse(ResponseInterface $response): void
{
$this->response = $response;
}
public function getResponse(): ?ResponseInterface
{
return $this->response;
}
public function isPropagationStopped(): bool
{
return $this->response !== null;
}
}
@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Resource\Event;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceStorage;
/**
* This event is fired after a file name has been sanitized and before a file is added to FAL. Listeners can use this
* event to modify the file name, and name the file according to naming conventions of a specific project.
*/
final class SanitizeFileNameEvent
{
public function __construct(
private string $fileName,
private readonly string $originalFileName,
private readonly Folder $targetFolder,
private readonly ResourceStorage $storage,
private readonly DriverInterface $driver
) {}
public function getFileName(): string
{
return $this->fileName;
}
public function getOriginalFileName(): string
{
return $this->originalFileName;
}
public function setFileName(string $fileName): void
{
$this->fileName = $fileName;
}
public function getTargetFolder(): Folder
{
return $this->targetFolder;
}
public function getStorage(): ResourceStorage
{
return $this->storage;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
}