Feature: #110762 - File storage configuration file 

See forge#110762

Description 

File storages are now defined in config/system/file-storages.yaml, see Breaking: #110762 - File storages are configured in a file instead of the database for the format and the migration. This comes with new API for extensions.

Reading and writing the configuration 

\TYPO3\CMS\Core\Resource\Configuration\FileStorageConfiguration returns the normalized definitions with all defaults applied via getAll() and get(int $identifier) . \TYPO3\CMS\Core\Resource\Configuration\FileStorageConfigurationWriter changes the file: write(int $identifier, array $entry) adds or replaces one storage, remove(int $identifier) deletes one, apply(array $entries, array $removals) changes several storages in one step, for example to move the default flag, and writeAll(array $storages) writes a complete set into an empty file. The writer works on the file as written on disk, so %env()% placeholders of untouched entries survive. It validates the resulting set, imported files included, writes the file atomically and restores the previous file if the result read back is not the expected one. The writer is meant for command line tools and set up code, not for regular web requests.

After a write, the PSR-14 event \TYPO3\CMS\Core\Resource\Event\FileStorageConfigurationChangedEvent is dispatched. TYPO3 itself uses it to flush the storage repository.

StorageRepository->addLocalStorage(string $name, string $basePath, bool $default = false) is the shortcut for extensions that add a local directory as a storage programmatically. It never hands out an identifier that is still referenced by files, processed files, file mounts or folder collections.

Impact 

Storages can be versioned, reviewed and deployed with the project and differ per environment through placeholders.