Review main Ready for review Breaking

96738[!!!][FEATURE] Add Flysystem-based file storage drivers

Benni Mack CR +1 V 0 Nightmare +3476 −833 updated 11/19/26, 15:48

Commit message

league/flysystem is added as dependency, any Flysystem adapter can
now serve as FAL storage, e.g. S3, Azure, SFTP or WebDAV.

File storage drivers are registered with the attribute
FileStorageDriverFactoryInterface service or on a
FilesystemAdapterFactoryInterface service. Its identifier is the
driver of a storage, the storage configuration is passed to the
driver or factory. Factories are services and get their
dependencies injected, which was not possible for drivers so far.
Storages of an adapter factory use the new FlysystemDriver.
Drivers registered in $TYPO3_CONF_VARS keep working, a driver
registered with the attribute takes precedence.

AbstractFlysystemDriver adds what TYPO3 needs on top of Flysystem:
canonicalized identifiers (incl. case-insensitive storages) that
cannot leave the storage, sanitized file names, listings with
filters, sorting and pagination, counting without keeping the
listing, recursive folder rename/move/copy, local copies for
processing and streaming of files. Metadata from listings is
reused, so remote adapters are not asked for each property or
the permissions of each file and folder, and local copies are
discarded when a file changes. Identifiers are passed to Flysystem
with an own path normalizer, as the default one rejects file names
with characters like a zero-width joiner, which exist in storages.
MIME types follow the rules of local files: the type configured for
a file extension wins, MIME type guessers refine the type reported
by the adapter.

A storage is public with the option "baseUri". Public URLs of the
adapter are only used with the option "publicUrlsFromAdapter", as
adapters like the AWS S3 one generate them for private buckets too.

LocalDriver is based on it now, uses the local Flysystem adapter
and is registered with the attribute, so every installation uses
Flysystem for its local storages. It keeps its local specifics:
listings follow symbolic links, created files and folders get the
configured permissions and group, folders are moved at once, files
are processed and streamed in place. Protected listing methods of
LocalDriver have been removed or changed, its public API is
unchanged. Creating a file that exists already throws an
ExistingTargetFileNameException instead of keeping the file.

The DriverInterface stays untouched, existing drivers keep working.
File name sanitizing, filtering of listings and isWithin() move
to AbstractHierarchicalFilesystemDriver to be shared.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 10
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/38/96738/10 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/38/96738/10 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Fabien Udriot +1
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 49

Issues 1

Files 33

Show 13 more files

Review log 1525

  1. Benni Mack uploaded patch set 1 10/15/26, 20:40

  2. core-ci voted on patch set 1 V +1 10/15/26, 20:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111265

  3. Benni Mack uploaded patch set 2 V +1 10/30/26, 22:50

  4. core-ci voted on patch set 2 V -1 10/30/26, 22:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112926

  5. Benni Mack rebased onto patch set 3 V -1 10/31/26, 07:51

  6. core-ci voted on patch set 3 V -1 10/31/26, 07:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112942

  7. Benni Mack updated the commit message in patch set 4 V -1 11/10/26, 14:02

  8. core-ci voted on patch set 4 V -1 11/10/26, 14:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113905

  9. Benni Mack uploaded patch set 5 V -1 11/11/26, 15:06

  10. Benni Mack uploaded patch set 6 11/11/26, 15:14

  11. core-ci voted on patch set 5 V +1 11/11/26, 15:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114104

  12. core-ci voted on patch set 6 V +1 11/11/26, 15:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114108

  13. Benni Mack uploaded patch set 7 V +1 11/12/26, 21:00

  14. core-ci voted on patch set 7 V +1 11/12/26, 21:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114235

  15. Benni Mack uploaded patch set 8 V +1 11/15/26, 10:29

  16. core-ci voted on patch set 8 V +1 11/15/26, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114522

  17. Benni Mack uploaded patch set 9 V +1 11/15/26, 11:05

  18. core-ci voted on patch set 9 V +1 11/15/26, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114533

  19. Simon Schaufelberger commented on patch set 9 11/16/26, 12:56

    AbstractHierarchicalFilesystemDriver.php:31

    can you explain this pattern so that humans can also understand it?
  20. Benni Mack commented on patch set 9 11/16/26, 14:41

    AbstractHierarchicalFilesystemDriver.php:31 Reply

    it's continaing unsafe UTF8 characters we use for detection in the preg_match - it's been used in other places before, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/23439
  21. Simon Schaufelberger commented on patch set 9 CR +1 11/16/26, 14:59

    AbstractHierarchicalFilesystemDriver.php:31 Reply

    ok.
  22. Jochen Roth voted on patch set 9 CR +1 V +1 11/17/26, 09:49

  23. Benni Mack uploaded patch set 10 CR +1 V +1 11/19/26, 11:42

  24. core-ci voted on patch set 10 V +1 11/19/26, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115004

  25. Fabien Udriot voted on patch set 10 CR +1 11/19/26, 15:48