Breaking: #101291 - Introduce capabilities bit set

See forge#101291

Description

The capabilities property of the ResourceStorage and drivers (LocalDriver/AbstractDriver) have been converted from an integer (holding a bit value) to an instance of a new BitSet class \TYPO3\CMS\Core\Resource\Capabilities.

This affects the public API of the following interface methods:

  • \TYPO3\CMS\Core\Resource\Driver\DriverInterface::getCapabilities()
  • \TYPO3\CMS\Core\Resource\Driver\DriverInterface::mergeConfigurationCapabilities()

In consequence, all mentioned methods of implementations are affected as well, those of:

  • \TYPO3\CMS\Core\Resource\Driver\AbstractDriver::getCapabilities()
  • \TYPO3\CMS\Core\Resource\Driver\LocalDriver::mergeConfigurationCapabilities()

Also the following constants have been removed:

  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_BROWSABLE
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_PUBLIC
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_WRITABLE
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_HIERARCHICAL_IDENTIFIERS

Impact

The return type of the following methods, respective their implementations have changed from int to \TYPO3\CMS\Core\Resource\Capabilities:

  • \TYPO3\CMS\Core\Resource\Driver\DriverInterface::getCapabilities()
  • \TYPO3\CMS\Core\Resource\Driver\DriverInterface::mergeConfigurationCapabilities()

The type of the parameter $capabilities of the method mergeConfigurationCapabilities() has been changed from int to \TYPO3\CMS\Core\Resource\Capabilities.

The usage of the mentioned, removed constants of \TYPO3\CMS\Core\Resource\ResourceStorageInterface will lead to errors.

Affected installations

Installations that implement custom drivers and therefore directly implement \TYPO3\CMS\Core\Resource\Driver\DriverInterface or extend \TYPO3\CMS\Core\Resource\Driver\AbstractDriver.

Also, installations that use the removed constants of \TYPO3\CMS\Core\Resource\ResourceStorageInterface.

Migration

When using mentioned methods that formerly returned the bit value as integer or expected the bit value as integer parameter need to use the Capabilities class instead. It behaves exactly the same as the plain integer. If the plain integer value needs to be retrieved, __toInt() can be called on Capabilities instances.

The following removed constants

  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_BROWSABLE
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_PUBLIC
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_WRITABLE
  • \TYPO3\CMS\Core\Resource\ResourceStorageInterface::CAPABILITY_HIERARCHICAL_IDENTIFIERS

can be replaced with public constants of the new Capabilities class:

  • \TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_BROWSABLE
  • \TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_PUBLIC
  • \TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_WRITABLE
  • \TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_HIERARCHICAL_IDENTIFIERS