From 398b09203158df44ddc88796b697e214544badb5 Mon Sep 17 00:00:00 2001 From: Tim Kelty Date: Sun, 29 Dec 2024 21:41:50 -0500 Subject: [PATCH 1/2] Support DI for Guzzle client --- src/Craft.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Craft.php b/src/Craft.php index 31d626c7ffe..002a30c7a0d 100644 --- a/src/Craft.php +++ b/src/Craft.php @@ -398,7 +398,7 @@ public static function createGuzzleClient(array $config = []): Client $guzzleConfig['proxy'] = $generalConfig->httpProxy; } - return new Client($guzzleConfig); + return Craft::createObject(Client::class, [$guzzleConfig]); } } From 54a2bc612f6c2e1969efe0cef60379797196e539 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Wed, 1 Jan 2025 17:14:09 -0800 Subject: [PATCH 2/2] Release note [ci skip] --- CHANGELOG-WIP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md index c8c64ee1bff..89f0f4f12d7 100644 --- a/CHANGELOG-WIP.md +++ b/CHANGELOG-WIP.md @@ -11,6 +11,7 @@ - Deprecated the `ucfirst` Twig filter. `capitalize` should be used instead. ## Extensibility +- `GuzzleHttp\Client` is now instantiated via `Craft::createObject()`. ([#16366](https://github.com/craftcms/cms/pull/16366)) - `craft\helpers\DateTimeHelper::humanDuration()` now has a `$language` argument. ([#16332](https://github.com/craftcms/cms/pull/16332)) ## System