add some output in module commands

This commit is contained in:
Manuel Raynaud
2013-07-12 10:22:59 +02:00
parent 2941292fdd
commit b55833b2e2
2 changed files with 21 additions and 7 deletions

View File

@@ -70,15 +70,21 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate {
throw new \RuntimeException("schema.xml not found in Config directory. Needed file for generating model"); 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")) { 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"); $command = $this->getApplication()->find("module:generate:sql");
@@ -88,11 +94,11 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate {
"command" => $command->getName(), "command" => $command->getName(),
"name" => $this->module "name" => $this->module
)), )),
new StreamOutput(fopen('php://memory', 'w', false)) $output
); );
} }
protected function generateModel() protected function generateModel(OutputInterface $output)
{ {
$fs = new Filesystem(); $fs = new Filesystem();
$moduleBuildPropel = new ModelBuildCommand(); $moduleBuildPropel = new ModelBuildCommand();
@@ -104,7 +110,7 @@ class ModuleGenerateModelCommand extends BaseModuleGenerate {
"--output-dir" => THELIA_MODULE_DIR, "--output-dir" => THELIA_MODULE_DIR,
"--input-dir" => $this->moduleDirectory . DS ."Config" "--input-dir" => $this->moduleDirectory . DS ."Config"
)), )),
new StreamOutput(fopen('php://memory', 'w', false)) $output
); );
$verifyDirectories = array( $verifyDirectories = array(

View File

@@ -71,7 +71,15 @@ class ModuleGenerateSqlCommand extends BaseModuleGenerate {
"--output-dir" => $this->moduleDirectory . DS ."Config", "--output-dir" => $this->moduleDirectory . DS ."Config",
"--input-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');
} }
} }