You are here

public function MergeYamlCommand::execute in Database Sanitize 7

File

vendor/edisonlabs/merge-yaml/src/MergeYamlCommand.php, line 20

Class

MergeYamlCommand
Class MergeYamlCommand.

Namespace

EdisonLabs\MergeYaml

Code

public function execute(InputInterface $input, OutputInterface $output, array $configParameters = []) {
  $configFile = $input
    ->getOption('config');
  if ($configFile && empty($configParameters)) {
    $filePath = realpath($configFile);

    // Checks if the file is valid.
    if (!$filePath || !($configfileContent = file_get_contents($filePath))) {
      throw new \RuntimeException("Unable to load the config file {$configFile}");
    }
    $configParameters = json_decode($configfileContent, true);
  }
  $mergeYaml = new PluginHandler($this
    ->getComposer(), $this
    ->getIO(), $configParameters);
  $mergeYaml
    ->createMergeFiles();
}