add some output in module commands
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user