diff --git a/module/oc_telegram_shop/upload/cli.php b/module/oc_telegram_shop/upload/cli.php index 22de9a9..c21fc2d 100755 --- a/module/oc_telegram_shop/upload/cli.php +++ b/module/oc_telegram_shop/upload/cli.php @@ -2,6 +2,7 @@ add($app->get(ScheduleListCommand::class)); $console->add($app->get(PulseSendEventsCommand::class)); $console->add($app->get(ImagesWarmupCacheCommand::class)); $console->add($app->get(ImagesCacheClearCommand::class)); +$console->add($app->get(CacheClearCommand::class)); $console->add($app->get(CustomerCountsCommand::class)); $console->run(); diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CacheClearCommand.php b/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CacheClearCommand.php new file mode 100644 index 0000000..4a97d73 --- /dev/null +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CacheClearCommand.php @@ -0,0 +1,43 @@ +cache = $cache; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + + $io->title('Очистка кеша модуля TeleCart'); + + try { + $this->cache->clear(); + $io->success('Кеш успешно очищен!'); + + return Command::SUCCESS; + } catch (\Exception $e) { + $io->error('Ошибка при очистке кеша: ' . $e->getMessage()); + + return Command::FAILURE; + } + } +}