Connect Manager

ConnectManager implements ConnectManagerInterface

FinalYes

Унифицированный менеджер сетевых соединений (sync + async + HTTP + SSH/SFTP).

Tags
SuppressWarnings

("PHPMD.StaticAccess")

("PHPMD.CouplingBetweenObjects")

("PHPMD.TooManyPublicMethods")

Table of Contents

Interfaces

ConnectManagerInterface
Публичный фасад Connect Manager.

Constants

VERSION  : mixed = '1.1.0'
Версия API пакета (SemVer совместимости; релиз — через Packagist/git tag).

Methods

__construct()  : mixed
abort()  : never
Завершает работу с ошибкой пакета.
async()  : AsyncRuntimeInterface
Возвращает асинхронный рантайм.
connect()  : ConnectionInterface
Открывает соединение указанного протокола.
connectAsync()  : mixed
Открывает соединение асинхронно внутри Fiber-рантайма.
http()  : HttpClient
Прикладной HTTP-клиент (get/post/json/redirects).
httpExchange()  : string
HTTP/1.1 обмен поверх уже открытого соединения.
name()  : string
Возвращает идентификатор пакета Composer.
pool()  : ConnectionPoolInterface
Возвращает пул соединений.
protocols()  : ProtocolRegistryInterface
Возвращает реестр протоколов.
request()  : HttpResponse
Выполняет HTTP-запрос по URL.
sftp()  : SftpClient
Открывает прикладное SFTP-соединение и возвращает клиент.
ssh()  : SshConnection
Открывает прикладное SSH-соединение.

Constants

VERSION

Версия API пакета (SemVer совместимости; релиз — через Packagist/git tag).

public mixed VERSION = '1.1.0'

Methods

__construct()

public __construct([ProtocolRegistryInterface|null $registry = null ][, ConnectionFactoryInterface|null $factory = null ][, ConnectionPoolInterface|null $pool = null ][, AsyncRuntimeInterface|null $async = null ][, HttpClient|null $http = null ]) : mixed
Parameters
$registry : ProtocolRegistryInterface|null = null

Реестр протоколов

$factory : ConnectionFactoryInterface|null = null

Фабрика соединений

$pool : ConnectionPoolInterface|null = null

Пул

$async : AsyncRuntimeInterface|null = null

Async-рантайм

$http : HttpClient|null = null

HTTP-клиент

abort()

Завершает работу с ошибкой пакета.

public abort(string $message) : never
Parameters
$message : string
Tags
throws
ConnectManagerException
Return values
never

connectAsync()

Открывает соединение асинхронно внутри Fiber-рантайма.

public connectAsync(string $protocolId, string $endpoint, callable $onConnected[, ConnectionOptions|null $options = null ]) : mixed

Устанавливает соединение в non-blocking режиме (STREAM_CLIENT_ASYNC_CONNECT) с опросом готовности через async-рантайм.

Parameters
$protocolId : string
$endpoint : string
$onConnected : callable
$options : ConnectionOptions|null = null
Attributes
#[Override]

httpExchange()

HTTP/1.1 обмен поверх уже открытого соединения.

public httpExchange(ConnectionInterface $connection, string $method, string $target[, array<string, string> $headers = [] ][, string $body = '' ][, string $hostHeader = '' ]) : string
Parameters
$connection : ConnectionInterface
$method : string
$target : string
$headers : array<string, string> = []
$body : string = ''
$hostHeader : string = ''
Return values
string

name()

Возвращает идентификатор пакета Composer.

public name() : string
Attributes
#[Override]
Return values
string
On this page

Search results