Permalink
Browse files

Merge pull request #58 from openify/master

Add a simple Confirmation if --append option isn't set
  • Loading branch information...
2 parents a5103a7 + ebbd3bc commit 186d605aa6b592bd577e07e0e9a2c420b02b2492 @stof stof committed Aug 20, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 Command/LoadDataFixturesDoctrineCommand.php
@@ -68,6 +68,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$doctrine = $this->getContainer()->get('doctrine');
$em = $doctrine->getManager($input->getOption('em'));
+ if ($input->isInteractive() && !$input->getOption('append')) {
+ $dialog = $this->getHelperSet()->get('dialog');
+ if (!$dialog->askConfirmation($output, '<question>Careful, database will be purged. Do you want to continue Y/N ?</question>', false)) {
+ return;
+ }
+ }
+
$dirOrFile = $input->getOption('fixtures');
if ($dirOrFile) {
$paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile);

0 comments on commit 186d605

Please sign in to comment.