‪TYPO3CMS  9.5
ResourceFactory.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
27 
33 {
39  public static function ‪getInstance()
40  {
41  return GeneralUtility::makeInstance(__CLASS__);
42  }
43 
47  protected ‪$storageInstances = [];
48 
52  protected ‪$collectionInstances = [];
53 
57  protected ‪$fileInstances = [];
58 
62  protected ‪$fileReferenceInstances = [];
63 
69  protected $localDriverStorageCache;
70 
74  protected ‪$signalSlotDispatcher;
75 
81  public function __construct(‪Dispatcher ‪$signalSlotDispatcher = null)
82  {
83  $this->‪signalSlotDispatcher = ‪$signalSlotDispatcher ?: GeneralUtility::makeInstance(Dispatcher::class);
84  }
85 
94  public function ‪getDriverObject($driverIdentificationString, array $driverConfiguration)
95  {
97  $driverRegistry = GeneralUtility::makeInstance(Driver\DriverRegistry::class);
98  $driverClass = $driverRegistry->getDriverClass($driverIdentificationString);
99  $driverObject = GeneralUtility::makeInstance($driverClass, $driverConfiguration);
100  return $driverObject;
101  }
102 
113  public function ‪getDefaultStorage()
114  {
116  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
117 
118  $allStorages = $storageRepository->findAll();
119  foreach ($allStorages as $storage) {
120  if ($storage->isDefault()) {
121  return $storage;
122  }
123  }
124  return null;
125  }
137  public function ‪getStorageObject($uid, array $recordData = [], &$fileIdentifier = null)
138  {
139  if (!is_numeric($uid)) {
140  throw new \InvalidArgumentException('The UID of storage has to be numeric. UID given: "' . $uid . '"', 1314085991);
141  }
142  $uid = (int)$uid;
143  if ($uid === 0 && $fileIdentifier !== null) {
144  $uid = $this->‪findBestMatchingStorageByLocalPath($fileIdentifier);
145  }
146  if (empty($this->storageInstances[$uid])) {
147  $storageConfiguration = null;
148  list($_, $uid, $recordData, $fileIdentifier) = $this->‪emitPreProcessStorageSignal($uid, $recordData, $fileIdentifier);
149  // If the built-in storage with UID=0 is requested:
150  if ($uid === 0) {
151  $recordData = [
152  'uid' => 0,
153  'pid' => 0,
154  'name' => 'Fallback Storage',
155  'description' => 'Internal storage, mounting the main TYPO3_site directory.',
156  'driver' => 'Local',
157  'processingfolder' => 'typo3temp/assets/_processed_/',
158  // legacy code
159  'configuration' => '',
160  'is_online' => true,
161  'is_browsable' => true,
162  'is_public' => true,
163  'is_writable' => true,
164  'is_default' => false,
165  ];
166  $storageConfiguration = [
167  'basePath' => '/',
168  'pathType' => 'relative'
169  ];
170  } elseif ($recordData === [] || (int)$recordData['uid'] !== $uid) {
172  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
173  $recordData = $storageRepository->fetchRowByUid($uid);
174  }
175  $storageObject = $this->‪createStorageObject($recordData, $storageConfiguration);
176  $this->‪emitPostProcessStorageSignal($storageObject);
177  $this->storageInstances[$uid] = $storageObject;
178  }
179  return $this->storageInstances[$uid];
180  }
181 
190  protected function ‪emitPreProcessStorageSignal($uid, $recordData, $fileIdentifier)
191  {
192  return $this->‪signalSlotDispatcher->dispatch(\‪TYPO3\CMS\Core\Resource\ResourceFactory::class, self::SIGNAL_PreProcessStorage, [$this, $uid, $recordData, $fileIdentifier]);
193  }
194 
200  protected function ‪emitPostProcessStorageSignal(‪ResourceStorage $storageObject)
201  {
202  $this->‪signalSlotDispatcher->dispatch(self::class, self::SIGNAL_PostProcessStorage, [$this, $storageObject]);
203  }
204 
215  protected function ‪findBestMatchingStorageByLocalPath(&$localPath)
216  {
217  if ($this->localDriverStorageCache === null) {
219  }
220 
221  // normalize path information (`//`, `../`)
222  $localPath = ‪PathUtility::getCanonicalPath($localPath);
223  if ($localPath[0] !== '/') {
224  $localPath = '/' . $localPath;
225  }
226  $bestMatchStorageUid = 0;
227  $bestMatchLength = 0;
228  foreach ($this->localDriverStorageCache as $storageUid => $basePath) {
229  // try to match (resolved) relative base-path
230  if ($basePath->getRelative() !== null
231  && null !== $commonPrefix = ‪PathUtility::getCommonPrefix([$basePath->getRelative(), $localPath])
232  ) {
233  $matchLength = strlen($commonPrefix);
234  $basePathLength = strlen($basePath->getRelative());
235  if ($matchLength >= $basePathLength && $matchLength > $bestMatchLength) {
236  $bestMatchStorageUid = $storageUid;
237  $bestMatchLength = $matchLength;
238  }
239  }
240  // try to match (resolved) absolute base-path
241  if (null !== $commonPrefix = ‪PathUtility::getCommonPrefix([$basePath->getAbsolute(), $localPath])) {
242  $matchLength = strlen($commonPrefix);
243  $basePathLength = strlen($basePath->getAbsolute());
244  if ($matchLength >= $basePathLength && $matchLength > $bestMatchLength) {
245  $bestMatchStorageUid = $storageUid;
246  $bestMatchLength = $matchLength;
247  }
248  }
249  }
250  if ($bestMatchLength > 0) {
251  // $commonPrefix always has trailing slash, which needs to be excluded
252  // (commonPrefix: /some/path/, localPath: /some/path/file.png --> /file.png; keep leading slash)
253  $localPath = substr($localPath, $bestMatchLength - 1);
254  }
255  return $bestMatchStorageUid;
256  }
257 
261  protected function ‪initializeLocalStorageCache()
262  {
264  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
266  $storageObjects = $storageRepository->findByStorageType('Local');
267 
268  $this->localDriverStorageCache = [
269  // implicit legacy storage in project's public path
271  ];
272  foreach ($storageObjects as $localStorage) {
273  $configuration = $localStorage->getConfiguration();
274  if (!isset($configuration['basePath']) || !isset($configuration['pathType'])) {
275  continue;
276  }
277  if ($configuration['pathType'] === 'relative') {
278  $pathType = ‪LocalPath::TYPE_RELATIVE;
279  } elseif ($configuration['pathType'] === 'absolute') {
280  $pathType = ‪LocalPath::TYPE_ABSOLUTE;
281  } else {
282  continue;
283  }
284  $this->localDriverStorageCache[$localStorage->getUid()] = GeneralUtility::makeInstance(
285  LocalPath::class,
286  $configuration['basePath'],
287  $pathType
288  );
289  }
290  }
291 
298  public function ‪convertFlexFormDataToConfigurationArray($flexFormData)
299  {
300  $configuration = [];
301  if ($flexFormData) {
302  $flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
303  $configuration = $flexFormService->convertFlexFormContentToArray($flexFormData);
304  }
305  return $configuration;
306  }
307 
317  public function ‪getCollectionObject($uid, array $recordData = [])
318  {
319  if (!is_numeric($uid)) {
320  throw new \InvalidArgumentException('The UID of collection has to be numeric. UID given: "' . $uid . '"', 1314085999);
321  }
322  if (!$this->collectionInstances[$uid]) {
323  // Get mount data if not already supplied as argument to this function
324  if (empty($recordData) || $recordData['uid'] !== $uid) {
325  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_collection');
326  $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
327  $recordData = $queryBuilder->select('*')
328  ->from('sys_file_collection')
329  ->where(
330  $queryBuilder->expr()->eq(
331  'uid',
332  $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
333  )
334  )
335  ->execute()
336  ->fetch();
337  if (empty($recordData)) {
338  throw new \InvalidArgumentException('No collection found for given UID: "' . $uid . '"', 1314085992);
339  }
340  }
341  $collectionObject = $this->‪createCollectionObject($recordData);
342  $this->collectionInstances[$uid] = $collectionObject;
343  }
344  return $this->collectionInstances[$uid];
345  }
346 
353  public function ‪createCollectionObject(array $collectionData)
354  {
356  $registry = GeneralUtility::makeInstance(Collection\FileCollectionRegistry::class);
357 
359  $class = $registry->getFileCollectionClass($collectionData['type']);
360 
361  return $class::create($collectionData);
362  }
363 
371  public function ‪createStorageObject(array $storageRecord, array $storageConfiguration = null)
372  {
373  if (!$storageConfiguration) {
374  $storageConfiguration = $this->‪convertFlexFormDataToConfigurationArray($storageRecord['configuration']);
375  }
376  $driverType = $storageRecord['driver'];
377  $driverObject = $this->‪getDriverObject($driverType, $storageConfiguration);
378  return GeneralUtility::makeInstance(ResourceStorage::class, $driverObject, $storageRecord);
379  }
380 
389  public function ‪createFolderObject(ResourceStorage $storage, $identifier, $name)
390  {
391  return GeneralUtility::makeInstance(Folder::class, $storage, $identifier, $name);
392  }
393 
405  public function ‪getFileObject($uid, array $fileData = [])
406  {
407  if (!is_numeric($uid)) {
408  throw new \InvalidArgumentException('The UID of file has to be numeric. UID given: "' . $uid . '"', 1300096564);
409  }
410  if (empty($this->fileInstances[$uid])) {
411  // Fetches data in case $fileData is empty
412  if (empty($fileData)) {
413  $fileData = $this->‪getFileIndexRepository()->‪findOneByUid($uid);
414  if ($fileData === false) {
415  throw new Exception\FileDoesNotExistException('No file found for given UID: ' . $uid, 1317178604);
416  }
417  }
418  $this->fileInstances[$uid] = $this->‪createFileObject($fileData);
419  }
420  return $this->fileInstances[$uid];
421  }
422 
430  public function ‪getFileObjectFromCombinedIdentifier($identifier)
431  {
432  if (!isset($identifier) || !is_string($identifier) || $identifier === '') {
433  throw new \InvalidArgumentException('Invalid file identifier given. It must be of type string and not empty. "' . gettype($identifier) . '" given.', 1401732564);
434  }
435  $parts = GeneralUtility::trimExplode(':', $identifier);
436  if (count($parts) === 2) {
437  $storageUid = $parts[0];
438  $fileIdentifier = $parts[1];
439  } else {
440  // We only got a path: Go into backwards compatibility mode and
441  // use virtual Storage (uid=0)
442  $storageUid = 0;
443  $fileIdentifier = $parts[0];
444  }
445 
446  // please note that getStorageObject() might modify $fileIdentifier when
447  // auto-detecting the best-matching storage to use
448  return $this->‪getFileObjectByStorageAndIdentifier($storageUid, $fileIdentifier);
449  }
450 
460  public function ‪getFileObjectByStorageAndIdentifier($storageUid, &$fileIdentifier)
461  {
462  $storage = $this->‪getStorageObject($storageUid, [], $fileIdentifier);
463  if (!$storage->isWithinProcessingFolder($fileIdentifier)) {
464  $fileData = $this->‪getFileIndexRepository()->‪findOneByStorageUidAndIdentifier($storage->getUid(), $fileIdentifier);
465  if ($fileData === false) {
466  $fileObject = $this->‪getIndexer($storage)->createIndexEntry($fileIdentifier);
467  } else {
468  $fileObject = $this->‪getFileObject($fileData['uid'], $fileData);
469  }
470  } else {
471  $fileObject = $this->‪getProcessedFileRepository()->‪findByStorageAndIdentifier($storage, $fileIdentifier);
472  }
473 
474  return $fileObject;
475  }
476 
497  public function ‪retrieveFileOrFolderObject($input)
498  {
499  // Remove Environment::getPublicPath() because absolute paths under Windows systems contain ':'
500  // This is done in all considered sub functions anyway
501  $input = str_replace(‪Environment::getPublicPath() . '/', '', $input);
502 
503  if (GeneralUtility::isFirstPartOfStr($input, 'file:')) {
504  $input = substr($input, 5);
505  return $this->‪retrieveFileOrFolderObject($input);
506  }
508  return $this->‪getFileObject($input);
509  }
510  if (strpos($input, ':') > 0) {
511  list($prefix) = explode(':', $input);
513  // path or folder in a valid storageUID
514  return $this->‪getObjectFromCombinedIdentifier($input);
515  }
516  if ($prefix === 'EXT') {
517  $input = GeneralUtility::getFileAbsFileName($input);
518  if (empty($input)) {
519  return null;
520  }
521 
523  return $this->‪getFileObjectFromCombinedIdentifier($input);
524  }
525  return null;
526  }
527  // this is a backwards-compatible way to access "0-storage" files or folders
528  // eliminate double slashes, /./ and /../
529  $input = ‪PathUtility::getCanonicalPath(ltrim($input, '/'));
530  if (@is_file(‪Environment::getPublicPath() . '/' . $input)) {
531  // only the local file
532  return $this->‪getFileObjectFromCombinedIdentifier($input);
533  }
534  // only the local path
535  return $this->‪getFolderObjectFromCombinedIdentifier($input);
536  }
537 
545  public function ‪getFolderObjectFromCombinedIdentifier($identifier)
546  {
547  $parts = GeneralUtility::trimExplode(':', $identifier);
548  if (count($parts) === 2) {
549  $storageUid = $parts[0];
550  $folderIdentifier = $parts[1];
551  } else {
552  // We only got a path: Go into backwards compatibility mode and
553  // use virtual Storage (uid=0)
554  $storageUid = 0;
555 
556  // please note that getStorageObject() might modify $folderIdentifier when
557  // auto-detecting the best-matching storage to use
558  $folderIdentifier = $parts[0];
559  // make sure to not use an absolute path, and remove Environment::getPublicPath if it is prepended
560  if (GeneralUtility::isFirstPartOfStr($folderIdentifier, ‪Environment::getPublicPath() . '/')) {
561  $folderIdentifier = ‪PathUtility::stripPathSitePrefix($parts[0]);
562  }
563  }
564  return $this->‪getStorageObject($storageUid, [], $folderIdentifier)->‪getFolder($folderIdentifier);
565  }
566 
573  public function ‪getStorageObjectFromCombinedIdentifier($identifier)
574  {
575  $parts = GeneralUtility::trimExplode(':', $identifier);
576  $storageUid = count($parts) === 2 ? $parts[0] : null;
577  return $this->‪getStorageObject($storageUid);
578  }
579 
588  public function ‪getObjectFromCombinedIdentifier($identifier)
589  {
590  list($storageId, $objectIdentifier) = GeneralUtility::trimExplode(':', $identifier);
591  $storage = $this->‪getStorageObject($storageId);
592  if ($storage->hasFile($objectIdentifier)) {
593  return $storage->getFile($objectIdentifier);
594  }
595  if ($storage->hasFolder($objectIdentifier)) {
596  return $storage->getFolder($objectIdentifier);
597  }
598  throw new Exception\ResourceDoesNotExistException('Object with identifier "' . $identifier . '" does not exist in storage', 1329647780);
599  }
600 
609  public function ‪createFileObject(array $fileData, ResourceStorage $storage = null)
610  {
612  if (array_key_exists('storage', $fileData) && ‪MathUtility::canBeInterpretedAsInteger($fileData['storage'])) {
613  $storageObject = $this->‪getStorageObject((int)$fileData['storage']);
614  } elseif ($storage !== null) {
615  $storageObject = $storage;
616  $fileData['storage'] = $storage->getUid();
617  } else {
618  throw new \RuntimeException('A file needs to reside in a Storage', 1381570997);
619  }
620  $fileObject = GeneralUtility::makeInstance(File::class, $fileData, $storageObject);
621  return $fileObject;
622  }
623 
635  public function ‪getFileReferenceObject($uid, array $fileReferenceData = [], $raw = false)
636  {
637  if (!is_numeric($uid)) {
638  throw new \InvalidArgumentException(
639  'The reference UID for the file (sys_file_reference) has to be numeric. UID given: "' . $uid . '"',
640  1300086584
641  );
642  }
643  if (!$this->fileReferenceInstances[$uid]) {
644  // Fetches data in case $fileData is empty
645  if (empty($fileReferenceData)) {
646  $fileReferenceData = $this->‪getFileReferenceData($uid, $raw);
647  if (!is_array($fileReferenceData)) {
648  throw new Exception\ResourceDoesNotExistException(
649  'No file reference (sys_file_reference) was found for given UID: "' . $uid . '"',
650  1317178794
651  );
652  }
653  }
654  $this->fileReferenceInstances[$uid] = $this->‪createFileReferenceObject($fileReferenceData);
655  }
656  return $this->fileReferenceInstances[$uid];
657  }
658 
667  public function ‪createFileReferenceObject(array $fileReferenceData)
668  {
670  $fileReferenceObject = GeneralUtility::makeInstance(FileReference::class, $fileReferenceData);
671  return $fileReferenceObject;
672  }
673 
681  protected function ‪getFileReferenceData($uid, $raw = false)
682  {
683  if (!$raw && TYPO3_MODE === 'BE') {
684  $fileReferenceData = ‪BackendUtility::getRecordWSOL('sys_file_reference', $uid);
685  } elseif (!$raw && is_object(‪$GLOBALS['TSFE'])) {
686  $fileReferenceData = ‪$GLOBALS['TSFE']->sys_page->checkRecord('sys_file_reference', $uid);
687  } else {
688  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_reference');
689  $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
690  $fileReferenceData = $queryBuilder->select('*')
691  ->from('sys_file_reference')
692  ->where(
693  $queryBuilder->expr()->eq(
694  'uid',
695  $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
696  )
697  )
698  ->execute()
699  ->fetch();
700  }
701  return $fileReferenceData;
702  }
703 
709  protected function ‪getFileIndexRepository()
710  {
712  }
713 
719  protected function ‪getProcessedFileRepository()
720  {
721  return GeneralUtility::makeInstance(ProcessedFileRepository::class);
722  }
723 
730  protected function ‪getIndexer(‪ResourceStorage $storage)
731  {
732  return GeneralUtility::makeInstance(Index\Indexer::class, $storage);
733  }
734 }
‪TYPO3\CMS\Core\Resource\ResourceFactory\signalSlotDispatcher
‪array< int, $localDriverStorageCache;protected Dispatcher $signalSlotDispatcher;public function __construct(Dispatcher $signalSlotDispatcher=null) { $this-> signalSlotDispatcher
Definition: ResourceFactory.php:77
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFileReferenceObject
‪FileReference createFileReferenceObject(array $fileReferenceData)
Definition: ResourceFactory.php:661
‪TYPO3\CMS\Core\Resource\ProcessedFileRepository
Definition: ProcessedFileRepository.php:29
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository
Definition: FileIndexRepository.php:41
‪TYPO3\CMS\Core\Resource\ResourceFactory\getCollectionObject
‪Collection AbstractFileCollection getCollectionObject($uid, array $recordData=[])
Definition: ResourceFactory.php:311
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:73
‪TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection
Definition: AbstractFileCollection.php:24
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:153
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFileObject
‪File createFileObject(array $fileData, ResourceStorage $storage=null)
Definition: ResourceFactory.php:603
‪TYPO3\CMS\Core\Resource\ResourceFactory\getProcessedFileRepository
‪ProcessedFileRepository getProcessedFileRepository()
Definition: ResourceFactory.php:713
‪TYPO3\CMS\Core\Resource\FileInterface
Definition: FileInterface.php:21
‪TYPO3\CMS\Core\Resource\ResourceFactory\getDriverObject
‪Driver DriverInterface getDriverObject($driverIdentificationString, array $driverConfiguration)
Definition: ResourceFactory.php:88
‪TYPO3\CMS\Core\Utility\PathUtility\dirname
‪static string dirname($path)
Definition: PathUtility.php:185
‪TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix
‪static string stripPathSitePrefix($path)
Definition: PathUtility.php:371
‪TYPO3\CMS\Core\Resource\ResourceFactory\emitPreProcessStorageSignal
‪mixed emitPreProcessStorageSignal($uid, $recordData, $fileIdentifier)
Definition: ResourceFactory.php:184
‪TYPO3\CMS\Core\Resource\ResourceFactory\getObjectFromCombinedIdentifier
‪FileInterface Folder getObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:582
‪TYPO3
‪TYPO3\CMS\Core\Resource\Index\Indexer
Definition: Indexer.php:33
‪TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObjectFromCombinedIdentifier
‪ResourceStorage getStorageObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:567
‪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:2462
‪TYPO3\CMS\Core\Resource\Driver\DriverInterface
Definition: DriverInterface.php:22
‪TYPO3\CMS\Core\Utility\PathUtility\getRelativePath
‪static string null getRelativePath($sourcePath, $targetPath)
Definition: PathUtility.php:72
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFolderObjectFromCombinedIdentifier
‪Folder getFolderObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:539
‪TYPO3\CMS\Core\Resource\ResourceFactory\initializeLocalStorageCache
‪initializeLocalStorageCache()
Definition: ResourceFactory.php:255
‪TYPO3\CMS\Core\Resource\FileReference
Definition: FileReference.php:31
‪TYPO3\CMS\Core\Resource\ResourceFactory\getInstance
‪static ResourceFactory getInstance()
Definition: ResourceFactory.php:39
‪TYPO3\CMS\Core\Resource\ResourceFactory\createStorageObject
‪ResourceStorage createStorageObject(array $storageRecord, array $storageConfiguration=null)
Definition: ResourceFactory.php:365
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByUid
‪array bool findOneByUid($fileUid)
Definition: FileIndexRepository.php:93
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifier
‪array bool findOneByStorageUidAndIdentifier($storageUid, $identifier)
Definition: FileIndexRepository.php:119
‪TYPO3\CMS\Core\Utility\PathUtility\getCanonicalPath
‪static string getCanonicalPath($path)
Definition: PathUtility.php:306
‪TYPO3\CMS\Core\Resource\ResourceFactory\$fileReferenceInstances
‪FileReference[] $fileReferenceInstances
Definition: ResourceFactory.php:58
‪TYPO3\CMS\Core\Utility\PathUtility\basename
‪static string basename($path)
Definition: PathUtility.php:164
‪TYPO3\CMS\Core\Resource\ResourceFactory\$fileInstances
‪File[] $fileInstances
Definition: ResourceFactory.php:54
‪TYPO3\CMS\Core\Service\FlexFormService
Definition: FlexFormService.php:21
‪TYPO3\CMS\Core\Resource\LocalPath\TYPE_ABSOLUTE
‪const TYPE_ABSOLUTE
Definition: LocalPath.php:30
‪TYPO3\CMS\Core\Resource\ResourceFactory\emitPostProcessStorageSignal
‪emitPostProcessStorageSignal(ResourceStorage $storageObject)
Definition: ResourceFactory.php:194
‪TYPO3\CMS\Core\Resource\ResourceFactory\$collectionInstances
‪Collection AbstractFileCollection[] $collectionInstances
Definition: ResourceFactory.php:50
‪TYPO3\CMS\Core\Resource\ResourceFactory\convertFlexFormDataToConfigurationArray
‪array convertFlexFormDataToConfigurationArray($flexFormData)
Definition: ResourceFactory.php:292
‪TYPO3\CMS\Core\Utility\PathUtility\getCommonPrefix
‪static string null getCommonPrefix(array $paths)
Definition: PathUtility.php:109
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:34
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:33
‪TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getInstance
‪static FileIndexRepository getInstance()
Definition: FileIndexRepository.php:70
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:23
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceObject
‪FileReference getFileReferenceObject($uid, array $fileReferenceData=[], $raw=false)
Definition: ResourceFactory.php:629
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectFromCombinedIdentifier
‪File ProcessedFile null getFileObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:424
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:174
‪TYPO3\CMS\Core\Resource
Definition: generateMimeTypes.php:37
‪TYPO3\CMS\Core\Resource\ProcessedFile
Definition: ProcessedFile.php:42
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileIndexRepository
‪FileIndexRepository getFileIndexRepository()
Definition: ResourceFactory.php:703
‪TYPO3\CMS\Core\Resource\ResourceFactory\createFolderObject
‪Folder createFolderObject(ResourceStorage $storage, $identifier, $name)
Definition: ResourceFactory.php:383
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:74
‪TYPO3\CMS\Core\Resource\ResourceFactory\getIndexer
‪Index Indexer getIndexer(ResourceStorage $storage)
Definition: ResourceFactory.php:724
‪TYPO3\CMS\Core\Resource\ResourceFactory\getStorageObject
‪ResourceStorage getStorageObject($uid, array $recordData=[], &$fileIdentifier=null)
Definition: ResourceFactory.php:131
‪TYPO3\CMS\Core\Resource\ResourceFactory\$storageInstances
‪ResourceStorage[] $storageInstances
Definition: ResourceFactory.php:46
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪$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:26
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:21
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObject
‪File getFileObject($uid, array $fileData=[])
Definition: ResourceFactory.php:399
‪TYPO3\CMS\Core\Resource\ResourceFactory\getDefaultStorage
‪ResourceStorage null getDefaultStorage()
Definition: ResourceFactory.php:107
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Core\Resource\ResourceFactory\findBestMatchingStorageByLocalPath
‪int findBestMatchingStorageByLocalPath(&$localPath)
Definition: ResourceFactory.php:209
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪$signalSlotDispatcher
‪$signalSlotDispatcher
Definition: ext_localconf.php:6
‪TYPO3\CMS\Core\Resource\ResourceFactory\retrieveFileOrFolderObject
‪File Folder null retrieveFileOrFolderObject($input)
Definition: ResourceFactory.php:491
‪TYPO3\CMS\Core\Resource\ResourceFactory\createCollectionObject
‪Collection AbstractFileCollection createCollectionObject(array $collectionData)
Definition: ResourceFactory.php:347
‪TYPO3\CMS\Core\Resource\ProcessedFileRepository\findByStorageAndIdentifier
‪ProcessedFile null findByStorageAndIdentifier(ResourceStorage $storage, $identifier)
Definition: ProcessedFileRepository.php:115
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileReferenceData
‪array null getFileReferenceData($uid, $raw=false)
Definition: ResourceFactory.php:675
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectByStorageAndIdentifier
‪File ProcessedFile null getFileObjectByStorageAndIdentifier($storageUid, &$fileIdentifier)
Definition: ResourceFactory.php:454
‪TYPO3\CMS\Extbase\SignalSlot\Dispatcher
Definition: Dispatcher.php:28
‪TYPO3\CMS\Core\Resource\ResourceFactoryInterface
Definition: ResourceFactoryInterface.php:21