Skip to content

Commit

Permalink
3965 remove UUID (#3989)
Browse files Browse the repository at this point in the history
* Add new arguments key and target. Make it possible use not only default target for db connections

* 1) Change optional-config from VALUE_OPTIONAL to VALUE_NONE, so it behaves the same way in the interaction and non-interaction mode 2) Fix the bug with uuids not removed from config, when we have dependencies we need to pass parameters for uuid and hash 3) Refactor the code clean up duplication of the code and extract parameters
  • Loading branch information
LOBsTerr committed Apr 9, 2019
1 parent 5e668f6 commit ca380de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/Command/Config/ExportContentTypeCommand.php
Expand Up @@ -128,7 +128,6 @@ protected function interact(InputInterface $input, OutputInterface $output)
}
$input->setOption('optional-config', $optionalConfig);


if (!$input->getOption('remove-uuid')) {
$removeUuid = $this->getIo()->confirm(
$this->trans('commands.config.export.content.type.questions.remove-uuid'),
Expand Down Expand Up @@ -167,5 +166,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
]
);
}

}
5 changes: 3 additions & 2 deletions src/Command/Shared/ExportTrait.php
Expand Up @@ -127,14 +127,15 @@ protected function fetchDependencies($config, $type = 'config')
return null;
}

protected function resolveDependencies($dependencies, $optional = false)
protected function resolveDependencies($dependencies, $optional = false, $uuid = false, $hash = false)
{
foreach ($dependencies as $dependency) {
if (!array_key_exists($dependency, $this->configExport)) {
$this->configExport[$dependency] = [
'data' => $this->getConfiguration($dependency),
'data' => $this->getConfiguration($dependency, $uuid, $hash),
'optional' => $optional
];

if ($dependencies = $this->fetchDependencies($this->configExport[$dependency], 'config')) {
$this->resolveDependencies($dependencies, $optional);
}
Expand Down

0 comments on commit ca380de

Please sign in to comment.