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

Public Member Functions

 __construct (LateBootService $lateBootService, FrontendInterface $dependencyInjectionCache)
 
 clearAll ()
 

Private Member Functions

 flushCaches (array $cacheConfiguration)
 

Private Attributes

const legacyDatabaseCacheTables
 
LateBootService $lateBootService
 
FrontendInterface $dependencyInjectionCache
 

Detailed Description

Basic service to clear caches within the install tool.

This is NOT an API class, it is for internal use in the install tool only.

Definition at line 28 of file ClearCacheService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Service\ClearCacheService::__construct ( LateBootService  $lateBootService,
FrontendInterface  $dependencyInjectionCache 
)

Member Function Documentation

◆ clearAll()

TYPO3\CMS\Install\Service\ClearCacheService::clearAll ( )

This clear cache implementation follows a pretty brutal approach. Goal is to reliably get rid of cache entries, even if some broken extension is loaded that would kill the backend 'clear cache' action.

Therefore this method "knows" implementation details of the cache framework and uses them to clear all file based cache (typo3temp/Cache) and database caches (tables prefixed with cf_) manually.

After that ext_tables and ext_localconf of extensions are loaded, those may register additional caches in the caching framework with different backend, and will then clear them with the usual flush() method.

Definition at line 63 of file ClearCacheService.php.

References $GLOBALS, and TYPO3\CMS\Install\Service\ClearCacheService\flushCaches().

◆ flushCaches()

TYPO3\CMS\Install\Service\ClearCacheService::flushCaches ( array  $cacheConfiguration)
private

The cache manager is already instantiated in the install tool (both in the failsafe and the late boot container), but with settings to disable caching (all caches using NullBackend). We want a "fresh" object here to operate with the really configured cache backends. CacheManager implements SingletonInterface, so the only way to get a "fresh" instance is by circumventing makeInstance and using new directly!

Parameters
array$cacheConfiguration

Definition at line 105 of file ClearCacheService.php.

Referenced by TYPO3\CMS\Install\Service\ClearCacheService\clearAll().

Member Data Documentation

◆ $dependencyInjectionCache

FrontendInterface TYPO3\CMS\Install\Service\ClearCacheService::$dependencyInjectionCache
private

◆ $lateBootService

LateBootService TYPO3\CMS\Install\Service\ClearCacheService::$lateBootService
private

◆ legacyDatabaseCacheTables

const TYPO3\CMS\Install\Service\ClearCacheService::legacyDatabaseCacheTables
private
Initial value:
= [
'cache_treelist',
]

Definition at line 30 of file ClearCacheService.php.