Added secure tests for the drop database command
This commit is contained in:
parent
096faad24a
commit
e27dc9cbd5
1 changed files with 8 additions and 0 deletions
|
|
@ -45,6 +45,14 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('force')) {
|
||||
if ('prod' === $this->getApplication()->getKernel()->getEnvironment()) {
|
||||
$this->writeSection($output, 'WARNING: you are about to drop a database in production !', 'bg=red;fg=white');
|
||||
if (false === $this->askConfirmation($output, 'Are you sure ? (y/n) ', false)) {
|
||||
$output->writeln('Aborted, nice decision !');
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:database:drop');
|
||||
|
||||
list($name, $config) = $this->getConnection($input, $output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue