‪TYPO3CMS  ‪main
TYPO3\CMS\Install\Service\Typo3tempFileService Class Reference

Public Member Functions

 __construct (private readonly ProcessedFileRepository $processedFileRepository, private readonly StorageRepository $storageRepository)
 
 getDirectoryStatistics ()
 
 getStatsFromStorageByUid (int $storageUid)
 
int clearProcessedFiles (int $storageUid)
 
bool clearAssetsFolder (string $folderName)
 

Protected Member Functions

 statsFromTypo3temp ()
 
 statsFromTypo3tempProcessed ()
 
 statsFromStorages ()
 
 getStatsFromStorage (ResourceStorage $storage)
 

Detailed Description

Service class to manage typo3temp/assets and FAL storage processed file statistics / cleanup.

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 31 of file Typo3tempFileService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Service\Typo3tempFileService::__construct ( private readonly ProcessedFileRepository  $processedFileRepository,
private readonly StorageRepository  $storageRepository 
)

Definition at line 33 of file Typo3tempFileService.php.

Member Function Documentation

◆ clearAssetsFolder()

bool TYPO3\CMS\Install\Service\Typo3tempFileService::clearAssetsFolder ( string  $folderName)

Clears files and folders in a typo3temp/assets/ folder (not processed!)

Returns
‪bool TRUE if all went well
Exceptions

Definition at line 160 of file Typo3tempFileService.php.

References TYPO3\CMS\Core\Core\Environment\getPublicPath(), and TYPO3\CMS\Core\Utility\GeneralUtility\rmdir().

◆ clearProcessedFiles()

int TYPO3\CMS\Install\Service\Typo3tempFileService::clearProcessedFiles ( int  $storageUid)

Clear processed files. The sys_file_processedfile table is cleared for given storage uid and the physical files of local processed storages are deleted.

Returns
‪int 0 if all went well, if >0 this number of files that could not be deleted

Definition at line 149 of file Typo3tempFileService.php.

◆ getDirectoryStatistics()

TYPO3\CMS\Install\Service\Typo3tempFileService::getDirectoryStatistics ( )

Returns a list of directory names in typo3temp/assets and their number of files

Definition at line 41 of file Typo3tempFileService.php.

References TYPO3\CMS\Install\Service\Typo3tempFileService\statsFromStorages(), and TYPO3\CMS\Install\Service\Typo3tempFileService\statsFromTypo3temp().

◆ getStatsFromStorage()

◆ getStatsFromStorageByUid()

TYPO3\CMS\Install\Service\Typo3tempFileService::getStatsFromStorageByUid ( int  $storageUid)

◆ statsFromStorages()

TYPO3\CMS\Install\Service\Typo3tempFileService::statsFromStorages ( )
protected

◆ statsFromTypo3temp()

TYPO3\CMS\Install\Service\Typo3tempFileService::statsFromTypo3temp ( )
protected

Directory statistics for typo3temp/assets folders with some special handling for legacy processed file storage processed

Definition at line 63 of file Typo3tempFileService.php.

References TYPO3\CMS\Core\Core\Environment\getPublicPath().

Referenced by TYPO3\CMS\Install\Service\Typo3tempFileService\getDirectoryStatistics().

◆ statsFromTypo3tempProcessed()

TYPO3\CMS\Install\Service\Typo3tempFileService::statsFromTypo3tempProcessed ( )
protected

Directory statistics for typo3temp/assets/_processed_ folder

Definition at line 94 of file Typo3tempFileService.php.

References TYPO3\CMS\Core\Core\Environment\getPublicPath().

Referenced by TYPO3\CMS\Install\Service\Typo3tempFileService\getStatsFromStorageByUid().