mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 12:06:40 +02:00
Added images dir to list of folders to clear. Plus added 'touching' of system.yaml to trigger clearing of APC/XCache/WinCache etc.
This commit is contained in:
@@ -12,7 +12,8 @@ use \Symfony\Component\Yaml\Yaml;
|
||||
class ClearCacheCommand extends Command {
|
||||
|
||||
protected $paths_to_remove = [
|
||||
'cache'
|
||||
'cache',
|
||||
'images'
|
||||
];
|
||||
|
||||
protected function configure() {
|
||||
@@ -44,6 +45,8 @@ class ClearCacheCommand extends Command {
|
||||
$output->writeln('<magenta>Clearing cache</magenta>');
|
||||
$output->writeln('');
|
||||
|
||||
$user_config = USER_DIR . 'config/system.yaml';
|
||||
|
||||
$anything = false;
|
||||
|
||||
foreach($this->paths_to_remove as $path) {
|
||||
@@ -57,6 +60,13 @@ class ClearCacheCommand extends Command {
|
||||
if ($anything) $output->writeln('<red>Cleared: </red>' . $path . '*');
|
||||
}
|
||||
|
||||
if (file_exists($user_config)) {
|
||||
touch ($user_config);
|
||||
$output->writeln('');
|
||||
$output->writeln('<red>Touched: </red>' . $user_config);
|
||||
$output->writeln('');
|
||||
}
|
||||
|
||||
if (!$anything) {
|
||||
$output->writeln('<green>Nothing to clear...</green>');
|
||||
$output->writeln('');
|
||||
|
||||
Reference in New Issue
Block a user