From 83f84172e02e8ea2ccb6dca29bc033e44c35aebc Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 19 Jul 2025 11:16:03 +0200 Subject: [PATCH] Add warning about APCu clear in CLI Adds a warning message if attempting to clear APCu cache from the CLI, as this is not supported. Users are advised to use the Admin Panel for clearing APCu cache outside of development environments. --- system/src/Commands/CacheClearCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/src/Commands/CacheClearCommand.php b/system/src/Commands/CacheClearCommand.php index 5b1715b5..ac899655 100644 --- a/system/src/Commands/CacheClearCommand.php +++ b/system/src/Commands/CacheClearCommand.php @@ -2,6 +2,7 @@ namespace MyAAC\Commands; +use MyAAC\Cache\Cache; use MyAAC\Hooks; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -26,6 +27,15 @@ class CacheClearCommand extends Command return Command::FAILURE; } + $cache = Cache::getInstance(); + + $cacheEngine = config('cache_engine') == 'auto' ? + Cache::detect() : config('cache_engine'); + + if (config('env') !== 'dev' && $cacheEngine == 'apcu') { + $io->warning('APCu cache cannot be cleared in CLI. Please visit the Admin Panel and clear there.'); + } + $io->success('Cache cleared'); return Command::SUCCESS; }