Skip to content

Commit

Permalink
WIP: minor adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 committed Apr 17, 2024
1 parent 657add2 commit f3a47ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/tech_details/api/occ_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The principal is similar to the regular Nextcloud OCC command for PHP apps, that
but for ExApps it is a trigger via Nextcloud OCC interface to perform some action on the External App side.


.. note::

Passing files directly as an input argument to the occ command is not supported.

Register
^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions lib/Service/ExAppOccService.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
foreach ($this->occCommand->getArguments() as $argument) {
$arguments[$argument['name']] = $input->getArgument($argument['name']);
}

$options = [];
foreach ($this->occCommand->getOptions() as $option) {
$options[$option['name']] = $input->getOption($option['name']);
}

$executeHandler = $this->occCommand->getExecuteHandler();
$response = $this->service->exAppRequest($this->occCommand->getAppid(), $executeHandler, null, 'POST', [], [
$response = $this->service->exAppRequest($this->occCommand->getAppid(), $executeHandler, params: [
'occ' => [
'arguments' => $arguments,
'options' => $options,
]
]);

if (!($response instanceof IResponse) && isset($response['error'])) {
$output->writeln(sprintf('[%s] command executeHandler failed. Error: %s', $this->occCommand->getName(), $response['error']));
$this->logger->error(sprintf('[%s] command executeHandler failed. Error: %s', $this->occCommand->getName(), $response['error']), [
Expand Down

0 comments on commit f3a47ca

Please sign in to comment.