Squashed commit message
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled

This commit is contained in:
2026-03-11 22:08:41 +03:00
commit 3abcb18f0c
588 changed files with 65779 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace Console\Commands;
use Acme\ECommerceFramework\Cache\CacheInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
class CacheClearCommand extends AcmeShopCommand
{
protected static $defaultName = 'cache:clear';
protected static $defaultDescription = 'Очистка кеша модуля AcmeShop';
private CacheInterface $cache;
public function __construct(CacheInterface $cache)
{
parent::__construct();
$this->cache = $cache;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->title('Очистка кеша модуля AcmeShop');
try {
$this->cache->clear();
$io->success('Кеш успешно очищен!');
return Command::SUCCESS;
} catch (\Exception $e) {
$io->error('Ошибка при очистке кеша: ' . $e->getMessage());
return Command::FAILURE;
}
}
}