‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\StorageRepository Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\StorageRepository:

Public Member Functions

 __construct (protected readonly EventDispatcherInterface $eventDispatcher, protected readonly DriverRegistry $driverRegistry,)
 
 getDefaultStorage ()
 
 findByUid (int $uid)
 
 findByCombinedIdentifier (string $identifier)
 
 flush ()
 
list< ResourceStoragefindByStorageType (string $storageType)
 
list< ResourceStoragefindAll ()
 
int< 0, createLocalStorage(string $name, string $basePath, string $pathType, string $description='', bool $default=false):int { $caseSensitive=$this-> testCaseSensitivity ($pathType==='relative' ? Environment::getPublicPath() . '/' . $basePath :$basePath)
 

Protected Member Functions

 fetchRecordDataByUid (int $uid)
 
 initializeLocalCache ()
 

Protected Attributes

array $storageRowCache = null
 
array $localDriverStorageCache = null
 
readonly string $table
 
array $storageInstances = []
 

Detailed Description

Repository for accessing the file storages

Definition at line 37 of file StorageRepository.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\StorageRepository::__construct ( protected readonly EventDispatcherInterface  $eventDispatcher,
protected readonly DriverRegistry  $driverRegistry 
)

Definition at line 58 of file StorageRepository.php.

Member Function Documentation

◆ fetchRecordDataByUid()

TYPO3\CMS\Core\Resource\StorageRepository::fetchRecordDataByUid ( int  $uid)
protected

◆ findAll()

list<ResourceStorage> TYPO3\CMS\Core\Resource\StorageRepository::findAll ( )

Returns a list of mountpoints that are available in the VFS. In case no storage exists this automatically created a storage for fileadmin/

Returns
‪list<ResourceStorage>

Definition at line 207 of file StorageRepository.php.

References TYPO3\CMS\Core\Resource\StorageRepository\initializeLocalCache().

Referenced by TYPO3\CMS\Core\Resource\StorageRepository\getDefaultStorage().

◆ findByCombinedIdentifier()

TYPO3\CMS\Core\Resource\StorageRepository::findByCombinedIdentifier ( string  $identifier)

Gets a storage object from a combined identifier

Parameters
non-empty-string$identifier‪An identifier of the form [storage uid]:[object identifier]

Definition at line 98 of file StorageRepository.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Core\Resource\StorageRepository\findByUid(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ findByStorageType()

list<ResourceStorage> TYPO3\CMS\Core\Resource\StorageRepository::findByStorageType ( string  $storageType)

Finds storages by type, i.e. the driver used

Parameters
non-empty-string$storageType
Returns
‪list<ResourceStorage>

Definition at line 183 of file StorageRepository.php.

References TYPO3\CMS\Core\Resource\StorageRepository\initializeLocalCache().

◆ findByUid()

TYPO3\CMS\Core\Resource\StorageRepository::findByUid ( int  $uid)

◆ flush()

TYPO3\CMS\Core\Resource\StorageRepository::flush ( )

Flush the internal storage caches to force reloading of storages with the next fetch.

Definition at line 170 of file StorageRepository.php.

Referenced by TYPO3\CMS\Core\Resource\StorageRepository\initializeLocalCache().

◆ getDefaultStorage()

TYPO3\CMS\Core\Resource\StorageRepository::getDefaultStorage ( )

Returns the Default Storage

The Default Storage is considered to be the replacement for the fileadmin/ construct. It is automatically created with the setting fileadminDir from install tool. getDefaultStorage->getDefaultFolder() will get you fileadmin/user_upload/ in a standard TYPO3 installation.

Definition at line 73 of file StorageRepository.php.

References TYPO3\CMS\Core\Resource\StorageRepository\findAll().

◆ initializeLocalCache()

◆ testCaseSensitivity()

int<0, createLocalStorage(string $name, string $basePath, string $pathType, string $description = '', bool $default = false): int { $caseSensitive = $this-> TYPO3\CMS\Core\Resource\StorageRepository::testCaseSensitivity (   $pathType = =='relative' ? Environment::getPublicPath() . '/' . $basePath :$basePath)

Create the initial local storage base e.g. for the fileadmin/ directory.

Parameters
non-empty-string$name
non-empty-string$basePath
non-empty-string$pathType
Returns
‪int<0, max>

Member Data Documentation

◆ $localDriverStorageCache

array TYPO3\CMS\Core\Resource\StorageRepository::$localDriverStorageCache = null
protected

Definition at line 49 of file StorageRepository.php.

◆ $storageInstances

array TYPO3\CMS\Core\Resource\StorageRepository::$storageInstances = []
protected

Definition at line 56 of file StorageRepository.php.

◆ $storageRowCache

array TYPO3\CMS\Core\Resource\StorageRepository::$storageRowCache = null
protected

Definition at line 44 of file StorageRepository.php.

◆ $table

readonly string TYPO3\CMS\Core\Resource\StorageRepository::$table
protected

Definition at line 51 of file StorageRepository.php.