class CacheClearCommand extends AbstractCommand

Properties

protected InputInterface $input from AbstractCommand
protected OutputInterface $output from AbstractCommand
protected int $isolatedExitCode from AbstractCommand

Methods

__construct(Store $cache, Dispatcher $events, Paths $paths, Formatter $formatter, AssetManager $assets, LocaleManager $locales, SettingsRepositoryInterface $settings, VersionerInterface $versioner)

No description

void
configureIsolation()

No description

int
execute(InputInterface $input, OutputInterface $output)

No description

CommandMutex
commandIsolationMutex()

No description

int
fire()

No description

bool
hasOption(string $name)

No description

void
info(string $message)

No description

void
comment(string $message)

No description

void
error(string $message)

Send an error or warning message to the user.

void
configure()

No description

CacheClearReport|null
clear(bool $force = false, callable|null $listener = null)

Empty the caches and rebuild what can be rebuilt here, describing what happened.

void
render(CacheClearReport $report)

No description

string
describe(array $row)

No description

void
warmAssets(CacheClearReport $report, bool $force)

No description

void
record(CacheClearReport $report, string $frontend, string|null $locale, string|null $localeName, array $compilers, Cloud $assetsDir, bool $force)

Rebuild some compilers and record one entry per bundle.

void
recordChunks(CacheClearReport $report, string $frontend, CompilerInterface $compiler, bool $force)

No description

int|null
bytes(Cloud $assetsDir, string $file)

No description

string
format(int $bytes)

No description

void
reportChunks(string $set, CompilerInterface $compiler, bool $force)

No description

Details

__construct(Store $cache, Dispatcher $events, Paths $paths, Formatter $formatter, AssetManager $assets, LocaleManager $locales, SettingsRepositoryInterface $settings, VersionerInterface $versioner)

Parameters

Store $cache
Dispatcher $events
Paths $paths
Formatter $formatter
AssetManager $assets
LocaleManager $locales
SettingsRepositoryInterface $settings
VersionerInterface $versioner

protected void configureIsolation()

Return Value

void

protected int execute(InputInterface $input, OutputInterface $output)

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

protected CommandMutex commandIsolationMutex()

Return Value

CommandMutex

protected int fire()

Return Value

int

protected bool hasOption(string $name)

Parameters

string $name

Return Value

bool

protected void info(string $message)

Parameters

string $message

Return Value

void

protected void comment(string $message)

Parameters

string $message

Return Value

void

protected void error(string $message)

Send an error or warning message to the user.

If possible, this will send the message via STDERR.

Parameters

string $message

Return Value

void

protected void configure()

Return Value

void

CacheClearReport|null clear(bool $force = false, callable|null $listener = null)

Empty the caches and rebuild what can be rebuilt here, describing what happened.

Returns null when the cache store could not be emptied, which is the one failure that leaves nothing worth reporting. Everything after that point is best-effort: the caches are already gone, so a step that cannot be pre-built is recorded and the command still succeeds — the render path rebuilds lazily, exactly as it did before any of this was warmed. Public so the admin panel can clear the cache and show the same detail the console does. A listener is called with each step as it finishes, for a caller streaming them to a browser rather than waiting for the lot.

Parameters

bool $force
callable|null $listener

Return Value

CacheClearReport|null

protected void render(CacheClearReport $report)

Parameters

CacheClearReport $report

Return Value

void

protected string describe(array $row)

Parameters

array $row

Return Value

string

protected void warmAssets(CacheClearReport $report, bool $force)

Parameters

CacheClearReport $report
bool $force

Return Value

void

protected void record(CacheClearReport $report, string $frontend, string|null $locale, string|null $localeName, array $compilers, Cloud $assetsDir, bool $force)

Rebuild some compilers and record one entry per bundle.

Per bundle rather than per step: a locale compiles both a js and a css bundle, and describing them as one thing hides which of them changed. The size is read only where a bundle was actually written. On remote storage that is a round trip, and a bundle whose revision did not move is byte-identical to the one reported the last time it changed.

Parameters

CacheClearReport $report
string $frontend
string|null $locale
string|null $localeName
array $compilers
Cloud $assetsDir
bool $force

Return Value

void

protected void recordChunks(CacheClearReport $report, string $frontend, CompilerInterface $compiler, bool $force)

Parameters

CacheClearReport $report
string $frontend
CompilerInterface $compiler
bool $force

Return Value

void

protected int|null bytes(Cloud $assetsDir, string $file)

Parameters

Cloud $assetsDir
string $file

Return Value

int|null

protected string format(int $bytes)

Parameters

int $bytes

Return Value

string

protected void reportChunks(string $set, CompilerInterface $compiler, bool $force)

Parameters

string $set
CompilerInterface $compiler
bool $force

Return Value

void