‪TYPO3CMS  10.4
ResourceFactory.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\EventDispatcher\EventDispatcherInterface;
36 
41 {
48  public static function ‪getInstance()
49  {
50  trigger_error('ResourceFactory::getInstance() will be removed in TYPO3 v11.0. Use constructor-level Dependency Injection or GeneralUtility::makeInstance(ResourceFactory::class) instead.', E_USER_DEPRECATED);
51  return GeneralUtility::makeInstance(__CLASS__);
52  }
53 
57  protected ‪$storageInstances = [];
58 
62  protected ‪$collectionInstances = [];
63 
67  protected ‪$fileInstances = [];
68 
72  protected ‪$fileReferenceInstances = [];
73 
79  protected $localDriverStorageCache;
80 
84  protected $eventDispatcher;
85 
89  public function __construct(EventDispatcherInterface $eventDispatcher)
90  {
91  $this->‪eventDispatcher = $eventDispatcher;
92  }
93 
102  public function ‪getDriverObject($driverIdentificationString, array $driverConfiguration)
103  {
105  $driverRegistry = GeneralUtility::makeInstance(DriverRegistry::class);
106  $driverClass = $driverRegistry->getDriverClass($driverIdentificationString);
107  $driverObject = GeneralUtility::makeInstance($driverClass, $driverConfiguration);
108  return $driverObject;
109  }
110 
121  public function ‪getDefaultStorage()
122  {
124  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
125 
126  $allStorages = $storageRepository->findAll();
127  foreach ($allStorages as $storage) {
128  if ($storage->isDefault()) {
129  return $storage;
130  }
131  }
132  return null;
133  }
145  public function ‪getStorageObject($uid, array $recordData = [], &$fileIdentifier = null)
146  {
147  if (!is_numeric($uid)) {
148  throw new \InvalidArgumentException('The UID of storage has to be numeric. UID given: "' . $uid . '"', 1314085991);
149  }
150  $uid = (int)$uid;
151  if ($uid === 0 && $fileIdentifier !== null) {
152  $uid = $this->‪findBestMatchingStorageByLocalPath($fileIdentifier);
153  }
154  if (empty($this->storageInstances[$uid])) {
155  $storageConfiguration = null;
157  $event = $this->‪eventDispatcher->dispatch(new BeforeResourceStorageInitializationEvent($uid, $recordData, $fileIdentifier));
158  $recordData = $event->getRecord();
159  $uid = $event->getStorageUid();
160  $fileIdentifier = $event->getFileIdentifier();
161  // If the built-in storage with UID=0 is requested:
162  if ($uid === 0) {
163  $recordData = [
164  'uid' => 0,
165  'pid' => 0,
166  'name' => 'Fallback Storage',
167  'description' => 'Internal storage, mounting the main TYPO3_site directory.',
168  'driver' => 'Local',
169  'processingfolder' => 'typo3temp/assets/_processed_/',
170  // legacy code
171  'configuration' => '',
172  'is_online' => true,
173  'is_browsable' => true,
174  'is_public' => true,
175  'is_writable' => true,
176  'is_default' => false,
177  ];
178  $storageConfiguration = [
179  'basePath' => '/',
180  'pathType' => 'relative'
181  ];
182  } elseif ($recordData === [] || (int)$recordData['uid'] !== $uid) {
184  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
185  $recordData = $storageRepository->fetchRowByUid($uid);
186  }
187  $storageObject = $this->‪createStorageObject($recordData, $storageConfiguration);
188  $storageObject = $this->‪eventDispatcher
189  ->dispatch(new AfterResourceStorageInitializationEvent($storageObject))
190  ->getStorage();
191  $this->storageInstances[$uid] = $storageObject;
192  }
193  return $this->storageInstances[$uid];
194  }
195 
206  protected function ‪findBestMatchingStorageByLocalPath(&$localPath)
207  {
208  if ($this->localDriverStorageCache === null) {
210  }
211 
212  // normalize path information (`//`, `../`)
213  $localPath = ‪PathUtility::getCanonicalPath($localPath);
214  if ($localPath[0] !== '/') {
215  $localPath = '/' . $localPath;
216  }
217  $bestMatchStorageUid = 0;
218  $bestMatchLength = 0;
219  foreach ($this->localDriverStorageCache as $storageUid => $basePath) {
220  // try to match (resolved) relative base-path
221  if ($basePath->getRelative() !== null
222  && null !== $commonPrefix = ‪PathUtility::getCommonPrefix([$basePath->getRelative(), $localPath])
223  ) {
224  $matchLength = strlen($commonPrefix);
225  $basePathLength = strlen($basePath->getRelative());
226  if ($matchLength >= $basePathLength && $matchLength > $bestMatchLength) {
227  $bestMatchStorageUid = $storageUid;
228  $bestMatchLength = $matchLength;
229  }
230  }
231  // try to match (resolved) absolute base-path
232  if (null !== $commonPrefix = ‪PathUtility::getCommonPrefix([$basePath->getAbsolute(), $localPath])) {
233  $matchLength = strlen($commonPrefix);
234  $basePathLength = strlen($basePath->getAbsolute());
235  if ($matchLength >= $basePathLength && $matchLength > $bestMatchLength) {
236  $bestMatchStorageUid = $storageUid;
237  $bestMatchLength = $matchLength;
238  }
239  }
240  }
241  if ($bestMatchLength > 0) {
242  // $commonPrefix always has trailing slash, which needs to be excluded
243  // (commonPrefix: /some/path/, localPath: /some/path/file.png --> /file.png; keep leading slash)
244  $localPath = substr($localPath, $bestMatchLength - 1);
245  }
246  return $bestMatchStorageUid;
247  }
248 
252  protected function ‪initializeLocalStorageCache()
253  {
255  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
257  $storageObjects = $storageRepository->findByStorageType('Local');
258 
259  $this->localDriverStorageCache = [
260  // implicit legacy storage in project's public path
262  ];
263  foreach ($storageObjects as $localStorage) {
264  $configuration = $localStorage->getConfiguration();
265  if (!isset($configuration['basePath']) || !isset($configuration['pathType'])) {
266  continue;
267  }
268  if ($configuration['pathType'] === 'relative') {
269  $pathType = ‪LocalPath::TYPE_RELATIVE;
270  } elseif ($configuration['pathType'] === 'absolute') {
271  $pathType = ‪LocalPath::TYPE_ABSOLUTE;
272  } else {
273  continue;
274  }
275  $this->localDriverStorageCache[$localStorage->getUid()] = GeneralUtility::makeInstance(
276  LocalPath::class,
277  $configuration['basePath'],
278  $pathType
279  );
280  }
281  }
282 
289  public function ‪convertFlexFormDataToConfigurationArray($flexFormData)
290  {
291  $configuration = [];
292  if ($flexFormData) {
293  $flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
294  $configuration = $flexFormService->convertFlexFormContentToArray($flexFormData);
295  }
296  return $configuration;
297  }
298 
308  public function ‪getCollectionObject($uid, array $recordData = [])
309  {
310  if (!is_numeric($uid)) {
311  throw new \InvalidArgumentException('The UID of collection has to be numeric. UID given: "' . $uid . '"', 1314085999);
312  }
313  if (!$this->collectionInstances[$uid]) {
314  // Get mount data if not already supplied as argument to this function
315  if (empty($recordData) || $recordData['uid'] !== $uid) {
316  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_collection');
317  $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
318  $recordData = $queryBuilder->select('*')
319  ->from('sys_file_collection')
320  ->where(
321  $queryBuilder->expr()->eq(
322  'uid',
323  $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
324  )
325  )
326  ->execute()
327  ->fetch();
328  if (empty($recordData)) {
329  throw new \InvalidArgumentException('No collection found for given UID: "' . $uid . '"', 1314085992);
330  }
331  }
332  $collectionObject = $this->‪createCollectionObject($recordData);
333  $this->collectionInstances[$uid] = $collectionObject;
334  }
335  return $this->collectionInstances[$uid];
336  }
337 
344  public function ‪createCollectionObject(array $collectionData)
345  {
347  $registry = GeneralUtility::makeInstance(FileCollectionRegistry::class);
348 
350  $class = $registry->getFileCollectionClass($collectionData['type']);
351 
352  return $class::create($collectionData);
353  }
354 
362  public function ‪createStorageObject(array $storageRecord, array $storageConfiguration = null)
363  {
364  if (!$storageConfiguration) {
365  $storageConfiguration = $this->‪convertFlexFormDataToConfigurationArray($storageRecord['configuration']);
366  }
367  $driverType = $storageRecord['driver'];
368  $driverObject = $this->‪getDriverObject($driverType, $storageConfiguration);
369  return GeneralUtility::makeInstance(ResourceStorage::class, $driverObject, $storageRecord, $this->‪eventDispatcher);
370  }
371 
380  public function ‪createFolderObject(ResourceStorage $storage, $identifier, $name)
381  {
382  return GeneralUtility::makeInstance(Folder::class, $storage, $identifier, $name);
383  }
384 
396  public function ‪getFileObject($uid, array $fileData = [])
397  {
398  if (!is_numeric($uid)) {
399  throw new \InvalidArgumentException('The UID of file has to be numeric. UID given: "' . $uid . '"', 1300096564);
400  }
401  if (empty($this->fileInstances[$uid])) {
402  // Fetches data in case $fileData is empty
403  if (empty($fileData)) {
404  $fileData = $this->‪getFileIndexRepository()->‪findOneByUid($uid);
405  if ($fileData === false) {
406  throw new FileDoesNotExistException('No file found for given UID: ' . $uid, 1317178604);
407  }
408  }
409  $this->fileInstances[$uid] = $this->‪createFileObject($fileData);
410  }
411  return $this->fileInstances[$uid];
412  }
413 
421  public function ‪getFileObjectFromCombinedIdentifier($identifier)
422  {
423  if (!is_string($identifier) || $identifier === '') {
424  throw new \InvalidArgumentException('Invalid file identifier given. It must be of type string and not empty. "' . gettype($identifier) . '" given.', 1401732564);
425  }
426  $parts = ‪GeneralUtility::trimExplode(':', $identifier);
427  if (count($parts) === 2) {
428  $storageUid = (int)$parts[0];
429  $fileIdentifier = $parts[1];
430  } else {
431  // We only got a path: Go into backwards compatibility mode and
432  // use virtual Storage (uid=0)
433  $storageUid = 0;
434  $fileIdentifier = $parts[0];
435  }
436 
437  // please note that getStorageObject() might modify $fileIdentifier when
438  // auto-detecting the best-matching storage to use
439  return $this->‪getFileObjectByStorageAndIdentifier($storageUid, $fileIdentifier);
440  }
441 
451  public function ‪getFileObjectByStorageAndIdentifier($storageUid, &$fileIdentifier)
452  {
453  $storage = $this->‪getStorageObject($storageUid, [], $fileIdentifier);
454  if (!$storage->isWithinProcessingFolder($fileIdentifier)) {
455  $fileData = $this->‪getFileIndexRepository()->‪findOneByStorageUidAndIdentifier($storage->getUid(), $fileIdentifier);
456  if ($fileData === false) {
457  $fileObject = $this->‪getIndexer($storage)->‪createIndexEntry($fileIdentifier);
458  } else {
459  $fileObject = $this->‪getFileObject($fileData['uid'], (array)$fileData);
460  }
461  } else {
462  $fileObject = $this->‪getProcessedFileRepository()->‪findByStorageAndIdentifier($storage, $fileIdentifier);
463  }
464 
465  return $fileObject;
466  }
467 
488  public function ‪retrieveFileOrFolderObject($input)
489  {
490  // Remove Environment::getPublicPath() because absolute paths under Windows systems contain ':'
491  // This is done in all considered sub functions anyway
492  $input = str_replace(‪Environment::getPublicPath() . '/', '', $input);
493 
494  if (GeneralUtility::isFirstPartOfStr($input, 'file:')) {
495  $input = substr($input, 5);
496  return $this->‪retrieveFileOrFolderObject($input);
497  }
499  return $this->‪getFileObject((int)$input);
500  }
501  if (strpos($input, ':') > 0) {
502  [$prefix] = explode(':', $input);
504  // path or folder in a valid storageUID
505  return $this->‪getObjectFromCombinedIdentifier($input);
506  }
507  if ($prefix === 'EXT') {
508  $input = GeneralUtility::getFileAbsFileName($input);
509  if (empty($input)) {
510  return null;
511  }
512 
514  return $this->‪getFileObjectFromCombinedIdentifier($input);
515  }
516  return null;
517  }
518  // this is a backwards-compatible way to access "0-storage" files or folders
519  // eliminate double slashes, /./ and /../
520  $input = ‪PathUtility::getCanonicalPath(ltrim($input, '/'));
521  if (@is_file(‪Environment::getPublicPath() . '/' . $input)) {
522  // only the local file
523  return $this->‪getFileObjectFromCombinedIdentifier($input);
524  }
525  // only the local path
526  return $this->‪getFolderObjectFromCombinedIdentifier($input);
527  }
528 
536  public function ‪getFolderObjectFromCombinedIdentifier($identifier)
537  {
538  $parts = ‪GeneralUtility::trimExplode(':', $identifier);
539  if (count($parts) === 2) {
540  $storageUid = (int)$parts[0];
541  $folderIdentifier = $parts[1];
542  } else {
543  // We only got a path: Go into backwards compatibility mode and
544  // use virtual Storage (uid=0)
545  $storageUid = 0;
546 
547  // please note that getStorageObject() might modify $folderIdentifier when
548  // auto-detecting the best-matching storage to use
549  $folderIdentifier = $parts[0];
550  // make sure to not use an absolute path, and remove Environment::getPublicPath if it is prepended
551  if (GeneralUtility::isFirstPartOfStr($folderIdentifier, ‪Environment::getPublicPath() . '/')) {
552  $folderIdentifier = ‪PathUtility::stripPathSitePrefix($parts[0]);
553  }
554  }
555  return $this->‪getStorageObject($storageUid, [], $folderIdentifier)->‪getFolder($folderIdentifier);
556  }
557 
564  public function ‪getStorageObjectFromCombinedIdentifier($identifier)
565  {
566  $parts = ‪GeneralUtility::trimExplode(':', $identifier);
567  $storageUid = count($parts) === 2 ? (int)$parts[0] : null;
568  return $this->‪getStorageObject($storageUid);
569  }
570 
579  public function ‪getObjectFromCombinedIdentifier($identifier)
580  {
581  [$storageId, $objectIdentifier] = ‪GeneralUtility::trimExplode(':', $identifier);
582  $storage = $this->‪getStorageObject((int)$storageId);
583  if ($storage->hasFile($objectIdentifier)) {
584  return $storage->getFile($objectIdentifier);
585  }
586  if ($storage->hasFolder($objectIdentifier)) {
587  return $storage->getFolder($objectIdentifier);
588  }
589  throw new ResourceDoesNotExistException('Object with identifier "' . $identifier . '" does not exist in storage', 1329647780);
590  }
591 
600  public function ‪createFileObject(array $fileData, ResourceStorage $storage = null)
601  {
602  if (array_key_exists('storage', $fileData) && ‪MathUtility::canBeInterpretedAsInteger($fileData['storage'])) {
603  $storageObject = $this->‪getStorageObject((int)$fileData['storage']);
604  } elseif ($storage !== null) {
605  $storageObject = $storage;
606  $fileData['storage'] = $storage->getUid();
607  } else {
608  throw new \RuntimeException('A file needs to reside in a Storage', 1381570997);
609  }
611  $fileObject = GeneralUtility::makeInstance(File::class, $fileData, $storageObject);
612  return $fileObject;
613  }
614 
626  public function ‪getFileReferenceObject($uid, array $fileReferenceData = [], $raw = false)
627  {
628  if (!is_numeric($uid)) {
629  throw new \InvalidArgumentException(
630  'The reference UID for the file (sys_file_reference) has to be numeric. UID given: "' . $uid . '"',
631  1300086584
632  );
633  }
634  if (!$this->fileReferenceInstances[$uid]) {
635  // Fetches data in case $fileData is empty
636  if (empty($fileReferenceData)) {
637  $fileReferenceData = $this->‪getFileReferenceData($uid, $raw);
638  if (!is_array($fileReferenceData)) {
639  throw new ResourceDoesNotExistException(
640  'No file reference (sys_file_reference) was found for given UID: "' . $uid . '"',
641  1317178794
642  );
643  }
644  }
645  $this->fileReferenceInstances[$uid] = $this->‪createFileReferenceObject($fileReferenceData);
646  }
647  return $this->fileReferenceInstances[$uid];
648  }
649 
658  public function ‪createFileReferenceObject(array $fileReferenceData)
659  {
661  $fileReferenceObject = GeneralUtility::makeInstance(FileReference::class, $fileReferenceData);
662  return $fileReferenceObject;
663  }
664 
672  protected function ‪getFileReferenceData($uid, $raw = false)
673  {
674  if (!$raw && TYPO3_MODE === 'BE') {
675  $fileReferenceData = ‪BackendUtility::getRecordWSOL('sys_file_reference', $uid);
676  } elseif (!$raw && is_object(‪$GLOBALS['TSFE'])) {
677  $fileReferenceData = ‪$GLOBALS['TSFE']->sys_page->checkRecord('sys_file_reference', $uid);
678  } else {
679  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_reference');
680  $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
681  $fileReferenceData = $queryBuilder->select('*')
682  ->from('sys_file_reference')
683  ->where(
684  $queryBuilder->expr()->eq(
685  'uid',
686  $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
687  )
688  )
689  ->execute()
690  ->fetch();
691  }
692  return $fileReferenceData;
693  }
694 
700  protected function ‪getFileIndexRepository()
701  {
703  }
704 
710  protected function ‪getProcessedFileRepository()
711  {
712  return GeneralUtility::makeInstance(ProcessedFileRepository::class);
713  }
714 
721  protected function ‪getIndexer(‪ResourceStorage $storage)
722  {
723  return GeneralUtility::makeInstance(Indexer::class, $storage);
724  }
725 }
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFileReferenceObject
‪FileReference createFileReferenceObject(array $fileReferenceData)
Definition: ResourceFactory.php:652
‪TYPO3\CMS\Core\Resource\ProcessedFileRepository
Definition: ProcessedFileRepository.php:30
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository
Definition: FileIndexRepository.php:45
‪TYPO3\CMS\Core\Resource\ResourceFactory\getCollectionObject
‪Collection AbstractFileCollection getCollectionObject($uid, array $recordData=[])
Definition: ResourceFactory.php:302
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:24
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection
Definition: AbstractFileCollection.php:27
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:180
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFileObject
‪File createFileObject(array $fileData, ResourceStorage $storage=null)
Definition: ResourceFactory.php:594
‪TYPO3\CMS\Core\Resource\ResourceFactory\getProcessedFileRepository
‪ProcessedFileRepository getProcessedFileRepository()
Definition: ResourceFactory.php:704
‪TYPO3\CMS\Core\Resource\FileInterface
Definition: FileInterface.php:22
‪TYPO3\CMS\Core\Resource\ResourceFactory\getDriverObject
‪Driver DriverInterface getDriverObject($driverIdentificationString, array $driverConfiguration)
Definition: ResourceFactory.php:96
‪TYPO3\CMS\Core\Utility\PathUtility\dirname
‪static string dirname($path)
Definition: PathUtility.php:186
‪TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix
‪static string stripPathSitePrefix($path)
Definition: PathUtility.php:372
‪TYPO3\CMS\Core\Resource\ResourceFactory\getObjectFromCombinedIdentifier
‪FileInterface Folder getObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:573
‪TYPO3\CMS\Core\Resource\Index\Indexer
Definition: Indexer.php:34
‪TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObjectFromCombinedIdentifier
‪ResourceStorage getStorageObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:558
‪TYPO3\CMS\Core\Resource\Index\Indexer\createIndexEntry
‪File createIndexEntry($identifier)
Definition: Indexer.php:68
‪TYPO3\CMS\Core\Resource\LocalPath\TYPE_RELATIVE
‪const TYPE_RELATIVE
Definition: LocalPath.php:31
‪TYPO3\CMS\Core\Resource\ResourceStorage\getFolder
‪Folder InaccessibleFolder getFolder($identifier, $returnInaccessibleFolderObject=false)
Definition: ResourceStorage.php:2541
‪TYPO3\CMS\Core\Resource\Driver\DriverInterface
Definition: DriverInterface.php:23
‪TYPO3\CMS\Core\Utility\PathUtility\getRelativePath
‪static string null getRelativePath($sourcePath, $targetPath)
Definition: PathUtility.php:73
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFolderObjectFromCombinedIdentifier
‪Folder getFolderObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:530
‪TYPO3\CMS\Core\Resource\ResourceFactory\initializeLocalStorageCache
‪initializeLocalStorageCache()
Definition: ResourceFactory.php:246
‪TYPO3\CMS\Core\Resource\FileReference
Definition: FileReference.php:33
‪TYPO3\CMS\Core\Resource\ResourceFactory\getInstance
‪static ResourceFactory getInstance()
Definition: ResourceFactory.php:48
‪TYPO3\CMS\Core\Resource\ResourceFactory\createStorageObject
‪ResourceStorage createStorageObject(array $storageRecord, array $storageConfiguration=null)
Definition: ResourceFactory.php:356
‪TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException
Definition: FileDoesNotExistException.php:22
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifier
‪array bool findOneByStorageUidAndIdentifier($storageUid, $identifier)
Definition: FileIndexRepository.php:132
‪TYPO3\CMS\Core\Utility\PathUtility\getCanonicalPath
‪static string getCanonicalPath($path)
Definition: PathUtility.php:307
‪TYPO3\CMS\Core\Resource\ResourceFactory\$fileReferenceInstances
‪FileReference[] $fileReferenceInstances
Definition: ResourceFactory.php:68
‪TYPO3\CMS\Core\Utility\PathUtility\basename
‪static string basename($path)
Definition: PathUtility.php:165
‪TYPO3\CMS\Core\Resource\ResourceFactory\$fileInstances
‪File[] $fileInstances
Definition: ResourceFactory.php:64
‪TYPO3\CMS\Core\Service\FlexFormService
Definition: FlexFormService.php:25
‪TYPO3\CMS\Core\Resource\LocalPath\TYPE_ABSOLUTE
‪const TYPE_ABSOLUTE
Definition: LocalPath.php:30
‪TYPO3\CMS\Core\Resource\Event\AfterResourceStorageInitializationEvent
Definition: AfterResourceStorageInitializationEvent.php:28
‪TYPO3\CMS\Core\Resource\ResourceFactory\$collectionInstances
‪Collection AbstractFileCollection[] $collectionInstances
Definition: ResourceFactory.php:60
‪TYPO3\CMS\Core\Resource\ResourceFactory\convertFlexFormDataToConfigurationArray
‪array convertFlexFormDataToConfigurationArray($flexFormData)
Definition: ResourceFactory.php:283
‪TYPO3\CMS\Core\Utility\PathUtility\getCommonPrefix
‪static string null getCommonPrefix(array $paths)
Definition: PathUtility.php:110
‪TYPO3\CMS\Core\Resource\ResourceFactory\eventDispatcher
‪array< int, $localDriverStorageCache;protected EventDispatcherInterface $eventDispatcher;public function __construct(EventDispatcherInterface $eventDispatcher) { $this-> eventDispatcher
Definition: ResourceFactory.php:85
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getInstance
‪static FileIndexRepository getInstance()
Definition: FileIndexRepository.php:78
‪TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException
Definition: ResourceDoesNotExistException.php:24
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:24
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceObject
‪FileReference getFileReferenceObject($uid, array $fileReferenceData=[], $raw=false)
Definition: ResourceFactory.php:620
‪TYPO3\CMS\Core\Resource\Collection\FileCollectionRegistry
Definition: FileCollectionRegistry.php:25
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectFromCombinedIdentifier
‪File ProcessedFile null getFileObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:415
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:139
‪TYPO3\CMS\Core\Resource
Definition: generateMimeTypes.php:52
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Core\Resource\ProcessedFile
Definition: ProcessedFile.php:44
‪TYPO3\CMS\Core\Resource\Driver\DriverRegistry
Definition: DriverRegistry.php:24
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileIndexRepository
‪FileIndexRepository getFileIndexRepository()
Definition: ResourceFactory.php:694
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFolderObject
‪Folder createFolderObject(ResourceStorage $storage, $identifier, $name)
Definition: ResourceFactory.php:374
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:122
‪TYPO3\CMS\Core\Resource\ResourceFactory\getIndexer
‪Index Indexer getIndexer(ResourceStorage $storage)
Definition: ResourceFactory.php:715
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByUid
‪array false findOneByUid($fileUid)
Definition: FileIndexRepository.php:106
‪TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject
‪ResourceStorage getStorageObject($uid, array $recordData=[], &$fileIdentifier=null)
Definition: ResourceFactory.php:139
‪TYPO3\CMS\Core\Resource\Event\BeforeResourceStorageInitializationEvent
Definition: BeforeResourceStorageInitializationEvent.php:27
‪TYPO3\CMS\Core\Resource\ResourceFactory\$storageInstances
‪ResourceStorage[] $storageInstances
Definition: ResourceFactory.php:56
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Resource\LocalPath
Definition: LocalPath.php:29
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:28
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObject
‪File getFileObject($uid, array $fileData=[])
Definition: ResourceFactory.php:390
‪TYPO3\CMS\Core\Resource\ResourceFactory\getDefaultStorage
‪ResourceStorage null getDefaultStorage()
Definition: ResourceFactory.php:115
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Resource\ResourceFactory\findBestMatchingStorageByLocalPath
‪int findBestMatchingStorageByLocalPath(&$localPath)
Definition: ResourceFactory.php:200
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Resource\ResourceFactory\retrieveFileOrFolderObject
‪File Folder null retrieveFileOrFolderObject($input)
Definition: ResourceFactory.php:482
‪TYPO3\CMS\Core\Resource\ResourceFactory\createCollectionObject
‪Collection AbstractFileCollection createCollectionObject(array $collectionData)
Definition: ResourceFactory.php:338
‪TYPO3\CMS\Core\Resource\ProcessedFileRepository\findByStorageAndIdentifier
‪ProcessedFile null findByStorageAndIdentifier(ResourceStorage $storage, $identifier)
Definition: ProcessedFileRepository.php:116
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceData
‪array null getFileReferenceData($uid, $raw=false)
Definition: ResourceFactory.php:666
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectByStorageAndIdentifier
‪File ProcessedFile null getFileObjectByStorageAndIdentifier($storageUid, &$fileIdentifier)
Definition: ResourceFactory.php:445
‪TYPO3\CMS\Core\Resource\ResourceFactoryInterface
Definition: ResourceFactoryInterface.php:24