‪TYPO3CMS  9.5
TYPO3\CMS\Core\Resource\ResourceFactory Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\ResourceFactory:
TYPO3\CMS\Core\Resource\ResourceFactoryInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

Driver DriverInterface getDriverObject ($driverIdentificationString, array $driverConfiguration)
 
ResourceStorage null getDefaultStorage ()
 
ResourceStorage getStorageObject ($uid, array $recordData=[], &$fileIdentifier=null)
 
array convertFlexFormDataToConfigurationArray ($flexFormData)
 
Collection AbstractFileCollection getCollectionObject ($uid, array $recordData=[])
 
Collection AbstractFileCollection createCollectionObject (array $collectionData)
 
ResourceStorage createStorageObject (array $storageRecord, array $storageConfiguration=null)
 
Folder createFolderObject (ResourceStorage $storage, $identifier, $name)
 
File getFileObject ($uid, array $fileData=[])
 
File ProcessedFile null getFileObjectFromCombinedIdentifier ($identifier)
 
File ProcessedFile null getFileObjectByStorageAndIdentifier ($storageUid, &$fileIdentifier)
 
File Folder null retrieveFileOrFolderObject ($input)
 
Folder getFolderObjectFromCombinedIdentifier ($identifier)
 
ResourceStorage getStorageObjectFromCombinedIdentifier ($identifier)
 
FileInterface Folder getObjectFromCombinedIdentifier ($identifier)
 
File createFileObject (array $fileData, ResourceStorage $storage=null)
 
FileReference getFileReferenceObject ($uid, array $fileReferenceData=[], $raw=false)
 
FileReference createFileReferenceObject (array $fileReferenceData)
 

Static Public Member Functions

static ResourceFactory getInstance ()
 

Protected Member Functions

mixed emitPreProcessStorageSignal ($uid, $recordData, $fileIdentifier)
 
 emitPostProcessStorageSignal (ResourceStorage $storageObject)
 
int findBestMatchingStorageByLocalPath (&$localPath)
 
 initializeLocalStorageCache ()
 
array null getFileReferenceData ($uid, $raw=false)
 
FileIndexRepository getFileIndexRepository ()
 
ProcessedFileRepository getProcessedFileRepository ()
 
Index Indexer getIndexer (ResourceStorage $storage)
 

Protected Attributes

ResourceStorage[] $storageInstances = array( )
 
Collection AbstractFileCollection[] $collectionInstances = array( )
 
File[] $fileInstances = array( )
 
FileReference[] $fileReferenceInstances = array( )
 
array< int, $localDriverStorageCache;protected Dispatcher $signalSlotDispatcher;public function __construct(Dispatcher $signalSlotDispatcher=null) { $this-> signalSlotDispatcher = $signalSlotDispatcher ?: GeneralUtility::makeInstance(Dispatcher::class)
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Resource\ResourceFactoryInterface
const SIGNAL_PreProcessStorage = 'preProcessStorage'
 
const SIGNAL_PostProcessStorage = 'postProcessStorage'
 

Detailed Description

Factory class for FAL objects

Todo:
‪implement constructor-level caching

Definition at line 32 of file ResourceFactory.php.

Member Function Documentation

◆ convertFlexFormDataToConfigurationArray()

array TYPO3\CMS\Core\Resource\ResourceFactory::convertFlexFormDataToConfigurationArray (   $flexFormData)

Converts a flexform data string to a flat array with key value pairs

Parameters
string$flexFormData
Returns
‪array Array with key => value pairs of the field data in the FlexForm

Definition at line 292 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceStorage\__construct(), TYPO3\CMS\Core\Resource\ResourceFactory\createStorageObject(), and TYPO3\CMS\Impexp\Import\isEquivalentObjectStorage().

◆ createCollectionObject()

Collection AbstractFileCollection TYPO3\CMS\Core\Resource\ResourceFactory::createCollectionObject ( array  $collectionData)

Creates a collection object.

Parameters
array$collectionData‪The database row of the sys_file_collection record.
Returns
Collection\AbstractFileCollection

Definition at line 347 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\FileCollectionRepository\createDomainObject(), and TYPO3\CMS\Core\Resource\ResourceFactory\getCollectionObject().

◆ createFileObject()

File TYPO3\CMS\Core\Resource\ResourceFactory::createFileObject ( array  $fileData,
ResourceStorage  $storage = null 
)

Creates a file object from an array of file data. Requires a database row to be fetched.

Parameters
array$fileData
ResourceStorage$storage
Returns
File

Definition at line 603 of file ResourceFactory.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), and TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

Referenced by TYPO3\CMS\Impexp\Export\export_addFilesFromSysFilesRecords(), and TYPO3\CMS\Core\Resource\ResourceFactory\getFileObject().

◆ createFileReferenceObject()

FileReference TYPO3\CMS\Core\Resource\ResourceFactory::createFileReferenceObject ( array  $fileReferenceData)

Creates a file usage object from an array of fileReference data from sys_file_reference table. Requires a database row to be already fetched and present.

Parameters
array$fileReferenceData
Returns
FileReference

Definition at line 661 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceObject().

◆ createFolderObject()

Folder TYPO3\CMS\Core\Resource\ResourceFactory::createFolderObject ( ResourceStorage  $storage,
  $identifier,
  $name 
)

Creates a folder to directly access (a part of) a storage.

Parameters
ResourceStorage$storage‪The storage the folder belongs to
string$identifier‪The path to the folder. Might also be a simple unique string, depending on the storage driver.
string$name‪The name of the folder (e.g. the folder name)
Returns
Folder

Definition at line 383 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceStorage\addFileMount(), TYPO3\CMS\Core\Resource\ResourceStorage\getFolder(), TYPO3\CMS\Core\Resource\ResourceStorage\getProcessingFolder(), TYPO3\CMS\Core\Resource\ResourceStorage\getProcessingFolders(), and TYPO3\CMS\Core\Resource\ResourceStorage\getRootLevelFolder().

◆ createStorageObject()

ResourceStorage TYPO3\CMS\Core\Resource\ResourceFactory::createStorageObject ( array  $storageRecord,
array  $storageConfiguration = null 
)

Creates a storage object from a storage database row.

Parameters
array$storageRecord
array$storageConfiguration‪Storage configuration (if given, this won't be extracted from the FlexForm value but the supplied array used instead)
Returns
ResourceStorage

Definition at line 365 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\convertFlexFormDataToConfigurationArray(), and TYPO3\CMS\Core\Resource\ResourceFactory\getDriverObject().

Referenced by TYPO3\CMS\Impexp\Import\checkImportPrerequisites(), and TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

◆ emitPostProcessStorageSignal()

TYPO3\CMS\Core\Resource\ResourceFactory::emitPostProcessStorageSignal ( ResourceStorage  $storageObject)
protected

Emits a signal after a resource storage was initialized

Parameters
ResourceStorage$storageObject

Definition at line 194 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\signalSlotDispatcher.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

◆ emitPreProcessStorageSignal()

mixed TYPO3\CMS\Core\Resource\ResourceFactory::emitPreProcessStorageSignal (   $uid,
  $recordData,
  $fileIdentifier 
)
protected

Emits a signal before a resource storage was initialized

Parameters
int$uid
array$recordData
string$fileIdentifier
Returns
‪mixed

Definition at line 184 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\signalSlotDispatcher.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

◆ findBestMatchingStorageByLocalPath()

int TYPO3\CMS\Core\Resource\ResourceFactory::findBestMatchingStorageByLocalPath ( $localPath)
protected

Checks whether a file resides within a real storage in local file system. If no match is found, uid 0 is returned which is a fallback storage pointing to fileadmin in public web path.

The file identifier is adapted accordingly to match the new storage's base path.

Parameters
string$localPath
Returns
‪int

Definition at line 209 of file ResourceFactory.php.

References TYPO3\CMS\Core\Utility\PathUtility\getCanonicalPath(), TYPO3\CMS\Core\Utility\PathUtility\getCommonPrefix(), and TYPO3\CMS\Core\Resource\ResourceFactory\initializeLocalStorageCache().

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

◆ getCollectionObject()

Collection AbstractFileCollection TYPO3\CMS\Core\Resource\ResourceFactory::getCollectionObject (   $uid,
array  $recordData = [] 
)

Creates an instance of the collection from given UID. The $recordData can be supplied to increase performance.

Parameters
int$uid‪The uid of the collection to instantiate.
array$recordData‪The record row from database.
Exceptions

Definition at line 311 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\createCollectionObject().

◆ getDefaultStorage()

ResourceStorage null TYPO3\CMS\Core\Resource\ResourceFactory::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.

Returns
‪ResourceStorage|null

Definition at line 107 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Impexp\Import\writeSysFileRecords(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ getDriverObject()

Driver DriverInterface TYPO3\CMS\Core\Resource\ResourceFactory::getDriverObject (   $driverIdentificationString,
array  $driverConfiguration 
)

Creates a driver object for a specified storage object.

Parameters
string$driverIdentificationString‪The driver class (or identifier) to use.
array$driverConfiguration‪The configuration of the storage
Returns
Driver\DriverInterface
Exceptions

Definition at line 88 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\createStorageObject().

◆ getFileIndexRepository()

FileIndexRepository TYPO3\CMS\Core\Resource\ResourceFactory::getFileIndexRepository ( )
protected

◆ getFileObject()

File TYPO3\CMS\Core\Resource\ResourceFactory::getFileObject (   $uid,
array  $fileData = [] 
)

Creates an instance of the file given UID. The $fileData can be supplied to increase performance.

Parameters
int$uid‪The uid of the file to instantiate.
array$fileData‪The record row from database.
Exceptions

Definition at line 399 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\createFileObject(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByUid(), and TYPO3\CMS\Core\Resource\ResourceFactory\getFileIndexRepository().

Referenced by TYPO3\CMS\Core\Resource\Security\FileMetadataPermissionsAspect\checkFileWriteAccessForFileMetaData(), TYPO3\CMS\Core\DataHandling\DataHandler\checkValue_group_select_file(), TYPO3\CMS\Core\Resource\Index\Indexer\createIndexEntry(), TYPO3\CMS\Core\Controller\FileDumpController\dumpAction(), TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\AbstractOnlineMediaHelper\findExistingFileByOnlineMediaId(), TYPO3\CMS\Backend\Controller\File\ThumbnailController\generateThumbnail(), TYPO3\CMS\Install\Updates\RowUpdater\ImageCropUpdater\getFile(), TYPO3\CMS\Backend\Form\Element\ImageManipulationElement\getFile(), TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectByStorageAndIdentifier(), TYPO3\CMS\Core\Resource\ResourceStorage\getFilesInFolder(), TYPO3\CMS\Backend\Backend\Avatar\DefaultAvatarProvider\getImage(), TYPO3\CMS\Extbase\Domain\Model\File\getOriginalResource(), TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController\getWizardContent(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\imageLinkWrap(), TYPO3\CMS\Frontend\Controller\ShowImageController\initialize(), TYPO3\CMS\Core\Resource\Search\Result\FileSearchResult\initialize(), TYPO3\CMS\Core\Resource\Index\Indexer\processChangedAndNewFiles(), TYPO3\CMS\Backend\Form\Element\FileInfoElement\render(), TYPO3\CMS\Backend\Form\Container\InlineRecordContainer\renderForeignRecordHeader(), TYPO3\CMS\Core\LinkHandling\FileLinkHandler\resolveFile(), TYPO3\CMS\Core\Resource\ResourceFactory\retrieveFileOrFolderObject(), TYPO3\CMS\Core\Resource\Index\Indexer\runMetaDataExtraction(), and TYPO3\CMS\Setup\Controller\SetupModuleController\setAvatarFileUid().

◆ getFileObjectByStorageAndIdentifier()

◆ getFileObjectFromCombinedIdentifier()

◆ getFileReferenceData()

array null TYPO3\CMS\Core\Resource\ResourceFactory::getFileReferenceData (   $uid,
  $raw = false 
)
protected

Gets data for the given uid of the file reference record.

Parameters
int$uid‪The uid of the file usage (sys_file_reference) to be fetched
bool$raw‪Whether to get raw results without performing overlays
Returns
‪array|null

Definition at line 675 of file ResourceFactory.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL().

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceObject().

◆ getFileReferenceObject()

FileReference TYPO3\CMS\Core\Resource\ResourceFactory::getFileReferenceObject (   $uid,
array  $fileReferenceData = [],
  $raw = false 
)

Creates an instance of a FileReference object. The $fileReferenceData can be supplied to increase performance.

Parameters
int$uid‪The uid of the file usage (sys_file_reference) to instantiate.
array$fileReferenceData‪The record row from database.
bool$raw‪Whether to get raw results without performing overlays
Returns
FileReference
Exceptions

Definition at line 629 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\createFileReferenceObject(), and TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceData().

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\__wakeup(), TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter\filterInlineChildren(), TYPO3\CMS\Extbase\Domain\Model\FileReference\getOriginalResource(), and TYPO3\CMS\Backend\Utility\BackendUtility\resolveFileReferences().

◆ getFolderObjectFromCombinedIdentifier()

◆ getIndexer()

Index Indexer TYPO3\CMS\Core\Resource\ResourceFactory::getIndexer ( ResourceStorage  $storage)
protected

Returns an instance of the Indexer

Parameters
ResourceStorage$storage
Returns
Index\Indexer

Definition at line 724 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectByStorageAndIdentifier().

◆ getInstance()

static ResourceFactory TYPO3\CMS\Core\Resource\ResourceFactory::getInstance ( )
static

Gets a singleton instance of this class.

Returns
ResourceFactory

Definition at line 39 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Extbase\Service\ImageService\__construct(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\__wakeup(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaGroup\addData(), TYPO3\CMS\Backend\Controller\OnlineMediaController\addMediaFromUrl(), TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\addShortcut(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\canBePastedInto(), TYPO3\CMS\Core\Resource\Security\FileMetadataPermissionsAspect\checkFileWriteAccessForFileMetaData(), TYPO3\CMS\Impexp\Import\checkImportPrerequisites(), TYPO3\CMS\Core\DataHandling\DataHandler\checkValue_group_select_file(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\deleteFileMovesFileToRecyclerFolderIfAvailable(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\deleteFileUnlinksFileIfNoRecyclerFolderAvailable(), TYPO3\CMS\Core\Controller\FileDumpController\dumpAction(), TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask\execute(), TYPO3\CMS\Scheduler\Task\FileStorageExtractionTask\execute(), TYPO3\CMS\Install\Updates\FileReferenceUpdate\executeUpdate(), TYPO3\CMS\Impexp\Export\export_addFilesFromSysFilesRecords(), TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter\filterInlineChildren(), TYPO3\CMS\Core\Utility\File\ExtendedFileUtility\func_upload(), TYPO3\CMS\Backend\Controller\File\ThumbnailController\generateThumbnail(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\getAdditionalAttributes(), TYPO3\CMS\Backend\Clipboard\Clipboard\getContentFromTab(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultUploadFolder(), TYPO3\CMS\Install\Updates\RowUpdater\ImageCropUpdater\getFile(), TYPO3\CMS\Backend\Form\Element\ImageManipulationElement\getFile(), TYPO3\CMS\Impexp\Controller\ImportExportController\getFile(), TYPO3\CMS\Core\Resource\FileReference\getFileObject(), TYPO3\CMS\Core\Resource\Search\QueryRestrictions\FolderMountsRestriction\getFolderMounts(), TYPO3\CMS\Backend\Backend\Avatar\DefaultAvatarProvider\getImage(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\getNestedProcessingFolderTest(), TYPO3\CMS\Extbase\Domain\Model\File\getOriginalResource(), TYPO3\CMS\Extbase\Domain\Model\FileReference\getOriginalResource(), TYPO3\CMS\Backend\Template\Components\MetaInformation\getPath(), TYPO3\CMS\Backend\Template\Components\MetaInformation\getRecordInformations(), TYPO3\CMS\Core\Database\ReferenceIndex\getRelations_procFiles(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getResourceFactory(), TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\AbstractOnlineMediaHelper\getResourceFactory(), TYPO3\CMS\Core\Resource\Index\Indexer\getResourceFactory(), TYPO3\CMS\Core\Resource\ResourceStorage\getResourceFactoryInstance(), TYPO3\CMS\Recordlist\LinkHandler\FileLinkHandler\getSelectedFolder(), TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController\getWizardContent(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\imageLinkWrap(), TYPO3\CMS\Backend\Controller\File\RenameFileController\init(), TYPO3\CMS\Backend\Controller\File\ReplaceFileController\init(), TYPO3\CMS\Backend\Controller\File\FileUploadController\init(), TYPO3\CMS\Backend\Controller\File\CreateFolderController\init(), TYPO3\CMS\Backend\Controller\File\EditFileController\init(), TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController\initFileOrFolderRecord(), TYPO3\CMS\Frontend\Controller\ShowImageController\initialize(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\initialize(), TYPO3\CMS\Core\Resource\Search\Result\FileSearchResult\initialize(), TYPO3\CMS\Impexp\Import\isEquivalentObjectStorage(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\isWithinFileMountBoundariesRespectsReadOnlyFileMounts(), TYPO3\CMS\Core\Resource\Collection\CategoryBasedFileCollection\loadContents(), TYPO3\CMS\T3editor\Hook\FileEditHook\preOutputProcessingHook(), TYPO3\CMS\Core\Resource\ProcessedFile\reconstituteFromDatabaseRecord(), TYPO3\CMS\Impexp\Export\removeSoftrefsHavingTheSameDatabaseRelation(), TYPO3\CMS\Backend\Form\Element\FileInfoElement\render(), TYPO3\CMS\Backend\Form\FieldWizard\FileThumbnails\render(), TYPO3\CMS\Backend\Form\Element\UserSysFileStorageIsPublicElement\render(), TYPO3\CMS\Recordlist\Browser\FolderBrowser\render(), TYPO3\CMS\Recordlist\Browser\FileBrowser\render(), TYPO3\CMS\Backend\Form\Container\InlineRecordContainer\renderForeignRecordHeader(), TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService\renderIsPublic(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\replaceFileFailsIfLocalFileDoesNotExist(), TYPO3\CMS\Backend\Utility\BackendUtility\resolveFileReferences(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\searchFilesFindsFilesInFolder(), TYPO3\CMS\Setup\Controller\SetupModuleController\setAvatarFileUid(), TYPO3\CMS\Impexp\Import\setRelations_db(), TYPO3\CMS\Form\Tests\Functional\Hooks\FormFileExtensionUpdateTest\setUp(), TYPO3\CMS\Core\Utility\File\ExtendedFileUtility\start(), TYPO3\CMS\Filelist\FileList\start(), TYPO3\CMS\Core\Html\RteHtmlParser\TS_images_db(), TYPO3\CMS\Core\Resource\File\updateProperties(), TYPO3\CMS\Scheduler\Task\FileStorageIndexingAdditionalFieldProvider\validateAdditionalFields(), TYPO3\CMS\Scheduler\Task\FileStorageExtractionAdditionalFieldProvider\validateAdditionalFields(), TYPO3\CMS\Impexp\Import\writeFileVerify(), TYPO3\CMS\Impexp\Import\writeSysFileRecords(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ getObjectFromCombinedIdentifier()

FileInterface Folder TYPO3\CMS\Core\Resource\ResourceFactory::getObjectFromCombinedIdentifier (   $identifier)

◆ getProcessedFileRepository()

ProcessedFileRepository TYPO3\CMS\Core\Resource\ResourceFactory::getProcessedFileRepository ( )
protected

◆ getStorageObject()

ResourceStorage TYPO3\CMS\Core\Resource\ResourceFactory::getStorageObject (   $uid,
array  $recordData = [],
$fileIdentifier = null 
)

Creates an instance of the storage from given UID. The $recordData can be supplied to increase performance.

Parameters
int$uid‪The uid of the storage to instantiate.
array$recordData‪The record row from database.
string$fileIdentifier‪Identifier for a file. Used for auto-detection of a storage, but only if $uid === 0 (Local default storage) is used
Exceptions

Definition at line 131 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\createStorageObject(), TYPO3\CMS\Core\Resource\ResourceFactory\emitPostProcessStorageSignal(), TYPO3\CMS\Core\Resource\ResourceFactory\emitPreProcessStorageSignal(), and TYPO3\CMS\Core\Resource\ResourceFactory\findBestMatchingStorageByLocalPath().

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\createFileObject(), TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask\execute(), TYPO3\CMS\Scheduler\Task\FileStorageExtractionTask\execute(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifier(), TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectByStorageAndIdentifier(), TYPO3\CMS\Core\Resource\ResourceFactory\getFolderObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Resource\ResourceFactory\getObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Resource\ResourceStorage\getProcessingFolder(), TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Resource\ProcessedFile\reconstituteFromDatabaseRecord(), TYPO3\CMS\Backend\Form\Element\UserSysFileStorageIsPublicElement\render(), TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService\renderIsPublic(), TYPO3\CMS\Form\Tests\Functional\Hooks\FormFileExtensionUpdateTest\setUp(), TYPO3\CMS\Core\Resource\File\updateProperties(), and TYPO3\CMS\Impexp\Import\writeSysFileRecords().

◆ getStorageObjectFromCombinedIdentifier()

ResourceStorage TYPO3\CMS\Core\Resource\ResourceFactory::getStorageObjectFromCombinedIdentifier (   $identifier)

Gets a storage object from a combined identifier

Parameters
string$identifier‪An identifier of the form [storage uid]:[object identifier]
Returns
ResourceStorage

Definition at line 567 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject().

◆ initializeLocalStorageCache()

TYPO3\CMS\Core\Resource\ResourceFactory::initializeLocalStorageCache ( )
protected

Creates an array mapping all uids to the basePath of storages using the "local" driver.

Definition at line 255 of file ResourceFactory.php.

References TYPO3\CMS\Core\Resource\LocalPath\TYPE_ABSOLUTE, and TYPO3\CMS\Core\Resource\LocalPath\TYPE_RELATIVE.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\findBestMatchingStorageByLocalPath().

◆ retrieveFileOrFolderObject()

File Folder null TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject (   $input)

Bulk function, can be used for anything to get a file or folder

  1. ‪It's a UID
  2. ‪It's a combined identifier
  3. ‪It's just a path/filename (coming from the oldstyle/backwards compatibility)

Files, previously laid on fileadmin/ or something, will be "mapped" to the storage the file is in now. Files like typo3temp/ or typo3conf/ will be moved to the first writable storage in its processing folder

$input could be

  • ‪"2:myfolder/myfile.jpg" (combined identifier)
  • ‪"23" (file UID)
  • ‪"uploads/myfile.png" (backwards-compatibility, storage "0")
  • ‪"file:23"
Parameters
string$input
Returns
‪File|Folder|null

Definition at line 491 of file ResourceFactory.php.

References TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Utility\PathUtility\dirname(), TYPO3\CMS\Core\Utility\PathUtility\getCanonicalPath(), TYPO3\CMS\Core\Resource\ResourceFactory\getFileObject(), TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Resource\ResourceFactory\getFolderObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Resource\ResourceFactory\getObjectFromCombinedIdentifier(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), and TYPO3\CMS\Core\Utility\PathUtility\getRelativePath().

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\__wakeup(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaGroup\addData(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\canBePastedInto(), TYPO3\CMS\Core\DataHandling\DataHandler\deleteRecord_flexFormCallBack(), TYPO3\CMS\Install\Updates\FileReferenceUpdate\executeUpdate(), TYPO3\CMS\Core\DataHandling\DataHandler\extFileFunctions(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\getAdditionalAttributes(), TYPO3\CMS\Backend\Clipboard\Clipboard\getContentFromTab(), TYPO3\CMS\Core\LinkHandling\LegacyLinkNotationConverter\getFileOrFolderObjectFromMixedIdentifier(), TYPO3\CMS\Core\Database\ReferenceIndex\getRelations_procFiles(), TYPO3\CMS\Recordlist\LinkHandler\FileLinkHandler\getSelectedFolder(), TYPO3\CMS\Backend\Controller\File\RenameFileController\init(), TYPO3\CMS\Backend\Controller\File\ReplaceFileController\init(), TYPO3\CMS\Backend\Controller\File\FileUploadController\init(), TYPO3\CMS\Backend\Controller\File\EditFileController\init(), TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController\initFileOrFolderRecord(), TYPO3\CMS\Frontend\Controller\ShowImageController\initialize(), TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider\initialize(), TYPO3\CMS\T3editor\Hook\FileEditHook\preOutputProcessingHook(), TYPO3\CMS\Core\DataHandling\DataHandler\removeRegisteredFiles(), TYPO3\CMS\Impexp\Export\removeSoftrefsHavingTheSameDatabaseRelation(), TYPO3\CMS\Recordlist\Browser\FileBrowser\render(), TYPO3\CMS\Core\Tests\Unit\Resource\ResourceFactoryTest\retrieveFileOrFolderObjectCallsGetFolderObjectFromCombinedIdentifierWithAbsolutePath(), TYPO3\CMS\Core\Tests\Unit\Resource\ResourceFactoryTest\retrieveFileOrFolderObjectCallsGetFolderObjectFromCombinedIdentifierWithRelativePath(), and TYPO3\CMS\Impexp\Import\setRelations_db().

Member Data Documentation

◆ $collectionInstances

Collection AbstractFileCollection [] TYPO3\CMS\Core\Resource\ResourceFactory::$collectionInstances = array( )
protected

Definition at line 50 of file ResourceFactory.php.

◆ $fileInstances

File [] TYPO3\CMS\Core\Resource\ResourceFactory::$fileInstances = array( )
protected

Definition at line 54 of file ResourceFactory.php.

◆ $fileReferenceInstances

FileReference [] TYPO3\CMS\Core\Resource\ResourceFactory::$fileReferenceInstances = array( )
protected

Definition at line 58 of file ResourceFactory.php.

◆ $storageInstances

ResourceStorage [] TYPO3\CMS\Core\Resource\ResourceFactory::$storageInstances = array( )
protected

Definition at line 46 of file ResourceFactory.php.

◆ signalSlotDispatcher

array<int, $localDriverStorageCache; protected Dispatcher $signalSlotDispatcher; public function __construct(Dispatcher $signalSlotDispatcher = null) { $this-> TYPO3\CMS\Core\Resource\ResourceFactory::signalSlotDispatcher = $signalSlotDispatcher ?: GeneralUtility::makeInstance(Dispatcher::class)
protected

A list of the base paths of "local" driver storages. Used to make the detection of base paths easier.

LocalPath>|null

Definition at line 77 of file ResourceFactory.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\emitPostProcessStorageSignal(), and TYPO3\CMS\Core\Resource\ResourceFactory\emitPreProcessStorageSignal().