2
我需要实现一种方法来在部署发生后清除composer.json文件中的redis缓存。 SNC的Redis的bundle命令是这样的:一旦部署发生,我该如何自动化Redis缓存清除?
namespace Snc\RedisBundle\Command;
/**
* Symfony command to execute redis flushall
*
*/
class RedisFlushallCommand extends RedisBaseCommand
{
/**
* {@inheritDoc}
*/
protected function configure()
{
parent::configure();
$this->setName('redis:flushall')
->setDescription('Flushes the redis database using the redis flushall command');
}
/**
* {@inheritDoc}
*/
protected function executeRedisCommand()
{
if ($this->proceedingAllowed()) {
$this->flushAll();
} else {
$this->output->writeln('<error>Flushing cancelled</error>');
}
}
/**
* Flushing all redis databases
*/
private function flushAll()
{
$this->redisClient->flushall();
$this->output->writeln('<info>All redis databases flushed</info>');
}
}
如何纳入汇composer.json
文件的源代码的根文件?我知道这可能是一个非常简单的方法,但我无法弄清楚。
是的,它的工作完全非常感谢你的帮助我真的很感激它! – user6405037
你能接受答案吗?它需要点击绿色支票 – chalasr
对不起,我再次点击它,再次感谢! – user6405037