Breaking: #92289 - Decouple logic of ResourceFactory into StorageRepository

See forge#92289

Description

The ResourceFactory class was initially created for the File Abstraction Layer (FAL) as a Factory class, which created PHP objects.

However, in the recent years, it became apparent that it is more useful to separate the concerns of the creation and retrieving of existing information.

For this reason, the StorageRepository class is now handling the creation of ResourceStorage objects. This layer accesses the Database and the needed Driver objects and configuration.

The StorageRepository class does not extend from AbstractRepository anymore, and is available standalone.

Most of the logic in the ResourceFactory concerning Storages has been moved to StorageRepository, which has a lot of options available now.

The following methods within ResourceFactory have been marked as internal, and are kept for backwards-compatibility without deprecation:

  • ResourceFactory->getDefaultStorage()

  • ResourceFactory->getStorageObject()

  • ResourceFactory->convertFlexFormDataToConfigurationArray()

  • ResourceFactory->createStorageObject()

  • ResourceFactory->createFolderObject()

  • ResourceFactory->getFileObjectByStorageAndIdentifier()

  • ResourceFactory->getStorageObjectFromCombinedIdentifier()

The following method has been removed

  • ResourceFactory->getDriverObject()

Impact

Calling the removed method will throw a fatal error.

Checking StorageRepository for an instance of AbstractRepository will have different results.

Affected Installations

TYPO3 installations with specific third-party extensions working with the FAL API directly might use the existing functionality.

Migration

Migrate to the StorageRepository API in the third-party extension code.