Skip to content

Commit

Permalink
added info-xml option
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey18106 committed Aug 15, 2023
1 parent 1a2dec3 commit cec9848
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Command/ExApp/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ protected function configure() {

$this->addOption('enabled', 'e', InputOption::VALUE_NONE, 'Enable ExApp after registration');
$this->addOption('force-scopes', null, InputOption::VALUE_NONE, 'Force scopes approval');
$this->addOption('info-xml', null, InputOption::VALUE_REQUIRED, '[required] Path to ExApp info.xml file (url or local absolute path)');
$this->addOption('json-info', null, InputOption::VALUE_REQUIRED, 'ExApp JSON deploy info');
}

Expand Down Expand Up @@ -123,7 +124,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}

$requestedExAppScopeGroups = $exAppInfo['scopes'] ?? $this->service->getExAppRequestedScopes($exApp);
$pathToInfoXml = $input->getOption('info-xml');
$infoXml = null;
if ($pathToInfoXml !== null) {
$infoXml = simplexml_load_string(file_get_contents($pathToInfoXml));
}

$requestedExAppScopeGroups = $exAppInfo['scopes'] ?? $this->service->getExAppRequestedScopes($exApp, $infoXml, $exAppJson ?? []);
if (isset($requestedExAppScopeGroups['error'])) {
$output->writeln($requestedExAppScopeGroups['error']);
// Fallback unregistering ExApp
Expand Down

0 comments on commit cec9848

Please sign in to comment.