vendor/doctrine/doctrine-cache-bundle/Command/FlushCommand.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Doctrine\Bundle\DoctrineCacheBundle\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Flush a cache provider.
*
* @author Alan Doucette <dragonwize@gmail.com>
*/
class FlushCommand extends CacheCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setName('doctrine:cache:flush')
->setAliases(array('doctrine:cache:clear'))
->setDescription('Flush a given cache')
->addArgument('cache-name', InputArgument::REQUIRED, 'Which cache provider to flush?');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$cacheName = $input->getArgument('cache-name');
$cacheProvider = $this->getCacheProvider($cacheName);
if ( ! method_exists($cacheProvider, 'flushAll')) {
throw new \RuntimeException('Cache provider does not implement a flushAll method.');
}
$cacheProviderName = get_class($cacheProvider);
$output->writeln(sprintf('Clearing the cache for the <info>%s</info> provider of type <info>%s</info>', $cacheName, $cacheProviderName, true));
$cacheProvider->flushAll();
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。