runAction example

$criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('name', $appName));

        $id = $this->appRepo->searchIds($criteria$context)->firstId();

        if (!$id) {
            $io->error("No app found for \"{$appName}\".");

            return self::FAILURE;
        }

        $this->runAction($id$context);

        $io->success(sprintf('App %sd successfully.', $this->action));

        return self::SUCCESS;
    }

    protected function configure(): void
    {
        $this->addArgument('name', InputArgument::REQUIRED, 'The name of the app, has also to be the name of the folder under which the app can be found under custom/apps');
    }
}


        if ($targetUrl) {
            $requestDataBag->set('url', $targetUrl);
        }

        $appExists = $appName === self::EXISTING_APP_NAME;
        if (!$appExists) {
            $this->expectException(AppByNameNotFoundException::class);
            $this->expectExceptionMessage(\sprintf('The provided name %s is invalid and no app could be found.', $appName));

            $this->adminExtensionApiController->runAction($requestDataBag$this->context);

            return;
        }

        if (empty($hosts)) {
            $this->expectException(UnallowedHostException::class);
        } else {
            $this->executor->expects(static::once())->method('execute')->with(static::callback(static fn (AppAction $action) => $action->getTargetUrl() === $targetUrl))->willReturn(new Response());
        }

        $response = $this->adminExtensionApiController->runAction($requestDataBag$this->context);
        
Home | Imprint | This part of the site doesn't use cookies.