getUserContextFromInput example

->addOption('user', 'u', InputOption::VALUE_OPTIONAL, 'User')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $context = Context::createDefaultContext();

        $pluginName = (string) $input->getOption('pluginName');
        $user = $input->getOption('user');

        $context = $this->getUserContextFromInput($user$context);

        $this->validatePluginIsNotManagedByComposer($pluginName$context);

        try {
            $data = $this->storeClient->getDownloadDataForPlugin($pluginName$context);
        } catch (ClientException $exception) {
            throw new StoreApiException($exception);
        }

        $this->pluginManagementService->downloadStorePlugin($data$context);

        
Home | Imprint | This part of the site doesn't use cookies.