From 5576005b6d773532b9c7409fb7a2be9f8d022a35 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Tue, 19 Apr 2011 14:23:33 +0200 Subject: [PATCH] Refactored command: status --- Command/MigrationStatusCommand.php | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/Command/MigrationStatusCommand.php b/Command/MigrationStatusCommand.php index d98f2dd..674d1ea 100644 --- a/Command/MigrationStatusCommand.php +++ b/Command/MigrationStatusCommand.php @@ -6,19 +6,10 @@ use Propel\PropelBundle\Command\PhingCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -/* - * This file is part of the Symfony framework. - * - * (c) Fabien Potencier - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - /** * MigrationStatusCommand. * - * @author William DURAND + * @author William DURAND */ class MigrationStatusCommand extends PhingCommand { @@ -30,8 +21,8 @@ class MigrationStatusCommand extends PhingCommand $this ->setDescription('Lists the migrations yet to be executed') ->setHelp(<<propel:migration:status command checks the version of the database structure, and looks for migration files not yet executed (i.e. with a greater version timestamp). - +The propel:migration:status command checks the version of the database structure, and looks for migration files not yet executed (i.e. with a greater version timestamp). + php app/console propel:migration:status EOT ) @@ -45,20 +36,9 @@ EOT * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) - { + { $this->callPhing('status'); - foreach (explode("\n", $this->buffer) as $line) { - if (false !== strpos($line, '[propel-migration-status]')) { - $arr = preg_split('#\[propel-migration-status\] #', $line); - $info = $arr[1]; - - if (' ' === $info[0]) { - $info = sprintf('%s', $info); - } - - $output->writeln($info); - } - } + $this->summary($output, 'propel-migration-status'); } }