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

Public Member Functions

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

Private Member Functions

 flushCaches (array $cacheConfiguration)
 

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 26 of file ClearCacheService.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 28 of file ClearCacheService.php.

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 46 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!

Definition at line 79 of file ClearCacheService.php.

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