diff --git a/composer.json b/composer.json index eca91be7..8b4bb5ee 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "beluga-php/docker-php", + "name": "binsky08/docker-php", "description": "A Docker PHP client", "license": "MIT", "type": "library", @@ -9,18 +9,28 @@ "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.45.*", + "binsky08/docker-php-api": "dev-main", "nyholm/psr7": "^1.8", "php-http/client-common": "^2.7", "php-http/discovery": "^1.19", "php-http/socket-client": "^2.3", "psr/http-message": "^2.0", "symfony/filesystem": "^6.3 || ^7.0 || ^8.0", + "symfony/http-client": "^6.3", "symfony/process": "^6.3 || ^7.0 || ^8.0", "symfony/serializer": "^6.3 || ^7.0 || ^8.0" }, + "suggest": { + "guzzlehttp/guzzle": "PSR-18 compliant HTTP Client to use the API" + }, "require-dev": { "ergebnis/composer-normalize": "^2.42", "friendsofphp/php-cs-fixer": "^3.8", diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index 39b07e89..37e96e6e 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -11,8 +11,8 @@ use Http\Client\Common\Plugin\HeaderDefaultsPlugin; use Http\Client\Common\PluginClient; use Http\Client\Common\PluginClientFactory; -use Http\Client\Socket\Client; use Http\Discovery\Psr17FactoryDiscovery; +use Symfony\Component\HttpClient\Psr18Client; final class DockerClientFactory { @@ -22,7 +22,7 @@ public static function create(array $config = [], ?PluginClientFactory $pluginCl $config['remote_socket'] = 'unix:///var/run/docker.sock'; } - $socketClient = new Client($config); + $socketClient = new Psr18Client(); $uriFactory = Psr17FactoryDiscovery::findUriFactory(); $host = preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket'];