From 4f1cc4ce05fc9f3bec6f06f1c0b6a34fa6a0803b Mon Sep 17 00:00:00 2001 From: William DURAND Date: Wed, 22 Jun 2011 16:45:41 +0200 Subject: [PATCH] Fixed PhingCommand + added a writeSection() method --- Command/PhingCommand.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Command/PhingCommand.php b/Command/PhingCommand.php index 4fe28da..2b79c15 100644 --- a/Command/PhingCommand.php +++ b/Command/PhingCommand.php @@ -160,7 +160,7 @@ abstract class PhingCommand extends ContainerAwareCommand $returnStatus = false; } - ob_end_flush(); + ob_end_clean(); chdir($kernel->getRootDir()); @@ -332,4 +332,17 @@ EOT; throw new \RuntimeException('Propel should be configured (no database configuration found).'); } } + + /** + * Comes from the SensioGeneratorBundle. + * @see https://github.com/sensio/SensioGeneratorBundle/blob/master/Command/Helper/DialogHelper.php#L52 + */ + public function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white') + { + $output->writeln(array( + '', + $this->getHelperSet()->get('formatter')->formatBlock($text, $style, true), + '', + )); + } }