From 719189353483de586799acd8e23378c006dfacaa Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 18 Oct 2023 16:07:35 +0200 Subject: [PATCH 1/3] use unreleased docker-php-api dev version --- composer.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c8d48c75..e7a7df5f 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "beluga-php/docker-php", + "name": "binsky08/docker-php", "license": "MIT", "type": "library", "description": "A Docker PHP client", @@ -29,9 +29,15 @@ "url": "https://github.com/flavioheleno" } ], + "repositories": { + "docker-php-api": { + "type": "vcs", + "url": "https://github.com/binsky08/docker-php-api.git" + } + }, "require": { "php": ">=8.1", - "beluga-php/docker-php-api": "7.1.43.x-dev", + "binsky08/docker-php-api": "dev-main", "psr/http-client": "^1.0", "psr/http-client-implementation": "*", "psr/http-message": "^1.1 || ^2.0", From 4b2a6f040685c2e6f8807fef2f6e3be37a85099b Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 18 Oct 2023 16:07:47 +0200 Subject: [PATCH 2/3] replace php-http client with symfony/http-client --- composer.json | 1 + src/DockerClientFactory.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e7a7df5f..408a1087 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "psr/http-message": "^1.1 || ^2.0", "psr/http-message-implementation": "*", "symfony/filesystem": "^6.1", + "symfony/http-client": "^6.3", "symfony/process": "^6.1" }, "suggest": { diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index 01bbed2d..862dbd5d 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -10,9 +10,9 @@ use Http\Client\Common\Plugin\DecoderPlugin; use Http\Client\Common\Plugin\HeaderDefaultsPlugin; use Http\Client\Common\PluginClientFactory; -use Http\Client\Socket\Client; use Http\Discovery\UriFactoryDiscovery; use Psr\Http\Client\ClientInterface; +use Symfony\Component\HttpClient\Psr18Client; final class DockerClientFactory { @@ -22,7 +22,7 @@ public static function create(array $config = [], PluginClientFactory $pluginCli $config['remote_socket'] = 'unix:///var/run/docker.sock'; } - $socketClient = new Client($config); + $socketClient = new Psr18Client(); $uriFactory = UriFactoryDiscovery::find(); $host = \preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket']; From d623262eb178202af488e4cef54a23df15fbda01 Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 18 Oct 2023 16:09:32 +0200 Subject: [PATCH 3/3] replace deprecated UriFactoryDiscovery --- src/DockerClientFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index 862dbd5d..e4f9945f 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -10,7 +10,7 @@ use Http\Client\Common\Plugin\DecoderPlugin; use Http\Client\Common\Plugin\HeaderDefaultsPlugin; use Http\Client\Common\PluginClientFactory; -use Http\Discovery\UriFactoryDiscovery; +use Http\Discovery\Psr17FactoryDiscovery; use Psr\Http\Client\ClientInterface; use Symfony\Component\HttpClient\Psr18Client; @@ -24,7 +24,7 @@ public static function create(array $config = [], PluginClientFactory $pluginCli $socketClient = new Psr18Client(); - $uriFactory = UriFactoryDiscovery::find(); + $uriFactory = Psr17FactoryDiscovery::findUriFactory(); $host = \preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket']; $pluginClientFactory = $pluginClientFactory ?? new PluginClientFactory();