From b55833b2e20b9fd7b665c981971fc3c9f5ca2e7b Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 12 Jul 2013 10:22:59 +0200 Subject: [PATCH] add some output in module commands --- .../Command/ModuleGenerateModelCommand.php | 18 ++++++++++++------ .../Command/ModuleGenerateSqlCommand.php | 10 +++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php index 27904400a..348765ced 100644 --- a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php @@ -70,15 +70,21 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate { throw new \RuntimeException("schema.xml not found in Config directory. Needed file for generating model"); } - $this->generateModel(); + $this->generateModel($output); + $output->renderBlock(array( + '', + 'Model generated successfuly', + '' + ), 'bg=green;fg=black'); if ($input->getOption("generate-sql")) { - $this->generateSql(); + $output->writeln(' '); + $this->generateSql($output); } } - protected function generateSql() + protected function generateSql(OutputInterface $output) { $command = $this->getApplication()->find("module:generate:sql"); @@ -88,11 +94,11 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate { "command" => $command->getName(), "name" => $this->module )), - new StreamOutput(fopen('php://memory', 'w', false)) + $output ); } - protected function generateModel() + protected function generateModel(OutputInterface $output) { $fs = new Filesystem(); $moduleBuildPropel = new ModelBuildCommand(); @@ -104,7 +110,7 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate { "--output-dir" => THELIA_MODULE_DIR, "--input-dir" => $this->moduleDirectory . DS ."Config" )), - new StreamOutput(fopen('php://memory', 'w', false)) + $output ); $verifyDirectories = array( diff --git a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php index 0f8cad20e..977075902 100644 --- a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php @@ -71,7 +71,15 @@ class ModuleGenerateSqlCommand extends BaseModuleGenerate { "--output-dir" => $this->moduleDirectory . DS ."Config", "--input-dir" => $this->moduleDirectory . DS ."Config" )), - new StreamOutput(fopen('php://memory', 'w', false)) + $output ); + + $output->renderBlock(array( + '', + 'Sql generated successfuly', + 'File available in your module config directory', + '' + ), 'bg=green;fg=black'); + } } \ No newline at end of file