UserAbortedCommandException example

private function grantPermissions(RefreshableAppDryRun $refreshableApps, ShopwareStyle $io): void
    {
        if (!$io->confirm(
            sprintf(
                "%d apps will be installed, %d apps will be updated and %d apps will be deleted.\nDo you want to continue?",
                \count($refreshableApps->getToBeInstalled()),
                \count($refreshableApps->getToBeUpdated()),
                \count($refreshableApps->getToBeDeleted())
            )
        )) {
            throw new UserAbortedCommandException();
        }

        foreach ($refreshableApps->getToBeInstalled() as $app) {
            $this->grantPermissionsForApp($app$io);

            $this->appPrinter->checkHosts($app$io);
        }

        foreach ($refreshableApps->getToBeUpdated() as $app) {
            $this->grantPermissionsForApp($app$io, false);

            


    private function checkPermissions(Manifest $manifest, ShopwareStyle $io): void
    {
        if ($manifest->getPermissions()) {
            $this->appPrinter->printPermissions($manifest$io, true);

            if (!$io->confirm(
                sprintf('Do you want to grant these permissions for app "%s"?', $manifest->getMetadata()->getName()),
                false
            )) {
                throw new UserAbortedCommandException();
            }
        }
    }
}
$hosts = $manifest->getAllHosts();
        if (empty($hosts)) {
            return;
        }

        $this->printHosts($manifest$hosts$io, true);

        if (!$io->confirm(
            'Do you consent with data being shared or transferred to the domains listed above?',
            false
        )) {
            throw new UserAbortedCommandException();
        }
    }

    private function printHosts(Manifest $app, array $hosts, ShopwareStyle $io, bool $install): void
    {
        $io->caution(
            sprintf(
                'App "%s" should be %s but requires communication with the following hosts:',
                $app->getMetadata()->getName(),
                $install ? 'installed' : 'updated'
            )
        );
Home | Imprint | This part of the site doesn't use cookies.