getAllHosts example

public function testGetAllHosts(): void
    {
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/_fixtures/test-manifest.xml');

        static::assertEquals([
            'my.app.com',
            'test.com',
            'base-url.com',
            'main-module',
            'swag-test.com',
            'payment.app',
        ]$manifest->getAllHosts());
    }
}
$manifest = Manifest::createFromXmlFile(__DIR__ . '/_fixtures/test/manifest.xml');

        static::assertEquals([
            'my.app.com',
            'test.com',
            'base-url.com',
            'main-module',
            'swag-test.com',
            'payment.app',
            'tax-provider.app',
            'tax-provider-2.app',
        ]$manifest->getAllHosts());
    }

    public function testGetEmptyConstraint(): void
    {
        $manifest = Manifest::createFromXmlFile(__DIR__ . '/_fixtures/test/manifest.xml');

        static::assertEquals('>=6.4.0', $manifest->getMetadata()->getCompatibility()->getPrettyString());
    }

    public function testFilledConstraint(): void
    {
        
class DomainsDeltaProvider extends AbstractAppDeltaProvider
{
    final public const DELTA_NAME = 'domains';

    public function getDeltaName(): string
    {
        return self::DELTA_NAME;
    }

    public function getReport(Manifest $manifest, AppEntity $app): array
    {
        return $manifest->getAllHosts();
    }

    public function hasDelta(Manifest $manifest, AppEntity $app): bool
    {
        $hosts = $manifest->getAllHosts();

        if (\count($hosts) < 1) {
            return false;
        }

        if (!$app->getAllowedHosts()) {
            

        );

        $this->printPermissionTable($io$permissions);
    }

    /** * @throws UserAbortedCommandException */
    public function checkHosts(Manifest $manifest, ShopwareStyle $io): void
    {
        $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();
        }
 AppEntity {
        // accessToken is not set on update, but in that case we don't run registration, so we won't need it         /** @var string $secretAccessKey */
        $secretAccessKey = $metadata['accessToken'] ?? '';
        unset($metadata['accessToken']$metadata['icon']);
        $metadata['path'] = str_replace($this->projectDir . '/', '', $manifest->getPath());
        $metadata['id'] = $id;
        $metadata['modules'] = [];
        $metadata['iconRaw'] = $this->getIcon($manifest);
        $metadata['cookies'] = $manifest->getCookies() !== null ? $manifest->getCookies()->getCookies() : [];
        $metadata['baseAppUrl'] = $manifest->getAdmin() !== null ? $manifest->getAdmin()->getBaseAppUrl() : null;
        $metadata['allowedHosts'] = $manifest->getAllHosts();
        $metadata['templateLoadPriority'] = $manifest->getStorefront() ? $manifest->getStorefront()->getTemplateLoadPriority() : 0;

        $this->updateMetadata($metadata$context);

        $app = $this->loadApp($id$context);

        $this->updateCustomEntities($app->getId()$app->getPath()$manifest);

        $this->permissionPersister->updatePrivileges($manifest->getPermissions()$roleId);

        // If the app has no secret yet, but now specifies setup data we do a registration to get an app secret
Home | Imprint | This part of the site doesn't use cookies.