Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple Confirmation if --append option isn't set #58

Merged
merged 4 commits into from Aug 20, 2012
Merged

Add a simple Confirmation if --append option isn't set #58

merged 4 commits into from Aug 20, 2012

Conversation

sylwit
Copy link

@sylwit sylwit commented Aug 18, 2012

Add a simple Confirmation if --append option isn't set

Add a simple Confirmation if --append option isn't set
@stof
Copy link
Member

stof commented Aug 19, 2012

This breaks things when the input is not interactive (as it will wait for the confirmation forever). You need to add this check only conditionally.

@sylwit
Copy link
Author

sylwit commented Aug 20, 2012

what do you think about adding a --forced option like for the doctrine:schema:update.

I guess it could prevent mistakes

@stof
Copy link
Member

stof commented Aug 20, 2012

you don't need a force. You simply need to check if the input is interactive before asking confirmation (the DoctrineMigrationsBundle does it)

@sylwit
Copy link
Author

sylwit commented Aug 20, 2012

Ok done, I didn't know this interactive method. Thanks for the tip

@@ -68,6 +68,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$doctrine = $this->getContainer()->get('doctrine');
$em = $doctrine->getManager($input->getOption('em'));

if ($input->isInteractive()) {
if (!$input->getOption('append')){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use && instead of nesting 2 if

@sylwit
Copy link
Author

sylwit commented Aug 20, 2012

done

stof added a commit that referenced this pull request Aug 20, 2012
Add a simple Confirmation if --append option isn't set
@stof stof merged commit 186d605 into doctrine:master Aug 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants