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

Public Member Functions

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

Protected Member Functions

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

Private Attributes

 $processedFileRepository
 
 $storageRepository
 

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 ( ProcessedFileRepository  $processedFileRepository,
StorageRepository  $storageRepository 
)

Member Function Documentation

◆ clearAssetsFolder()

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

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

Parameters
string$folderName
Returns
‪bool TRUE if all went well
Exceptions

Definition at line 174 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 161 of file Typo3tempFileService.php.

◆ getDirectoryStatistics()

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

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

Returns
‪array

Definition at line 47 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()

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

Directory statistics for configured FAL storages.

Returns
‪array

Definition at line 129 of file Typo3tempFileService.php.

References TYPO3\CMS\Install\Service\Typo3tempFileService\getStatsFromStorage().

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

◆ statsFromTypo3temp()

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

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

Returns
‪array

Definition at line 71 of file Typo3tempFileService.php.

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

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

◆ statsFromTypo3tempProcessed()

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

Directory statistics for typo3temp/assets/_processed_ folder

Returns
‪array

Definition at line 104 of file Typo3tempFileService.php.

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

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

Member Data Documentation

◆ $processedFileRepository

TYPO3\CMS\Install\Service\Typo3tempFileService::$processedFileRepository
private

◆ $storageRepository

TYPO3\CMS\Install\Service\Typo3tempFileService::$storageRepository
private