CacheFlushingContext

final readonly class \TYPO3\CMS\Core\Cache\Flush\CacheFlushingContext

Describes on whose behalf caches are flushed: the workspace the changes were made in, and whether flushing the "pages" group or all caches is permitted. The default context is unrestricted and meant for code running without a backend user, such as scheduler tasks or custom commands.

Table of Contents

Properties

$canFlushAllCaches  : bool
$canFlushPagesGroup  : bool
$workspaceId  : int

Methods

__construct()  : mixed
fromBackendUser()  : self
Admins may flush the "pages" group and all caches, unless User TSconfig "options.clearCache.all = 0" restricts the latter. Other users need "options.clearCache.pages = 1" or "options.clearCache.all = 1".

Properties

$canFlushAllCaches

public bool $canFlushAllCaches = true

$canFlushPagesGroup

public bool $canFlushPagesGroup = true

Methods

__construct()

public __construct([int $workspaceId = 0 ][, bool $canFlushPagesGroup = true ][, bool $canFlushAllCaches = true ]) : mixed

Parameters

$workspaceId : int = 0
$canFlushPagesGroup : bool = true
$canFlushAllCaches : bool = true

fromBackendUser()

Admins may flush the "pages" group and all caches, unless User TSconfig "options.clearCache.all = 0" restricts the latter. Other users need "options.clearCache.pages = 1" or "options.clearCache.all = 1".

public static fromBackendUser(BackendUserAuthentication $backendUser) : self

Parameters

$backendUser : BackendUserAuthentication

Return values

self
On this page