/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Stomp/Connection/Factory.php
54 строки
1 KB
Dmytro Horytskyi
ACP2E-4349: [B2B] Purchase orders not auto-converting to sales order with ActiveMQ
13 май 2026, 09:27
13 май 2026, 09:27
2e4a4eb
Код
Авторство
О чём код?
<?php /** * Copyright 2025 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Stomp\Connection; use Stomp\Exception\ConnectionException; use Stomp\Network\Connection; /** * Create connection based on options. */ class Factory { /** * Create connection according to given options. * * @param FactoryOptions $options * @return Connection * @throws ConnectionException */ public function create(FactoryOptions $options): Connection { if ($options->isSslEnabled()) { $broker = 'ssl://' . $options->getHost() . ':' . $options->getPort(); $streamContext = ['ssl' => $options->getSslOptions()]; $connection = $this->createConnectionInstance($broker, 1, $streamContext); } else { $broker = 'tcp://' . $options->getHost() . ':' . $options->getPort(); $connection = $this->createConnectionInstance($broker); } return $connection; } // In Factory.php /** * Create connection instance * * @param string $broker * @param int $timeout * @param array $context * @return Connection * @throws ConnectionException */ protected function createConnectionInstance(string $broker, int $timeout = 1, array $context = []): Connection { return new Connection($broker, $timeout, $context); } }