From 7cc36ee07c9caf41df67feb2531628d1a57e8488 Mon Sep 17 00:00:00 2001 From: Marcin Kucharski Date: Wed, 12 Jun 2013 12:39:39 +0200 Subject: [PATCH 1/2] Support for --verbose --- Command/AbstractCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php index 1e35c3a..bb21aec 100644 --- a/Command/AbstractCommand.php +++ b/Command/AbstractCommand.php @@ -95,6 +95,10 @@ abstract class AbstractCommand extends ContainerAwareCommand protected function initialize(InputInterface $input, OutputInterface $output) { parent::initialize($input, $output); + + if ($input->getOption('verbose')) { + $this->additionalPhingArgs[] = 'verbose'; + } $this->input = $input; From 6c2a2bf56568f8cfb8609cb5300a26e555ce7801 Mon Sep 17 00:00:00 2001 From: Marcin Kucharski Date: Wed, 12 Jun 2013 12:41:12 +0200 Subject: [PATCH 2/2] Show error message when uncommited migrations are found --- Command/MigrationGenerateDiffCommand.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Command/MigrationGenerateDiffCommand.php b/Command/MigrationGenerateDiffCommand.php index 6ff16cf..cfeaa13 100644 --- a/Command/MigrationGenerateDiffCommand.php +++ b/Command/MigrationGenerateDiffCommand.php @@ -47,8 +47,16 @@ EOT */ protected function execute(InputInterface $input, OutputInterface $output) { - $this->callPhing('diff'); - - $this->writeSummary($output, 'propel-sql-diff'); + if (true === $this->callPhing('diff')) { + $this->writeSummary($output, 'propel-sql-diff'); + } elseif ( strpos( $this->buffer, 'Uncommitted migrations have been found' ) ) { + $this->writeSection($output, array( + '[Propel] Error', + '', + 'Uncommitted migrations have been found. You should either execute or delete them before rerunning the propel:migration:generate-diff command.' + ), 'fg=white;bg=red'); + } else { + $this->writeTaskError($output, 'propel-sql-diff'); + } } }