Migrate from Guzzle to Symfony HttpClient

This commit is contained in:
Yassine Guedidi
2025-01-09 01:14:27 +01:00
parent 335054c9a3
commit 63dc176302
12 changed files with 322 additions and 964 deletions

View File

@ -32,7 +32,6 @@ class AppKernel extends Kernel
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
new Http\HttplugBundle\HttplugBundle(),
new Sentry\SentryBundle\SentryBundle(),
new Twig\Extra\TwigExtraBundle\TwigExtraBundle(),
new Symfony\WebpackEncoreBundle\WebpackEncoreBundle(),

View File

@ -48,6 +48,10 @@ framework:
X-Accept: 'application/json'
request_html_function.client:
scope: '.*'
browser.client:
scope: '.*'
verify_host: false
verify_peer: false
# Twig Configuration
twig:
@ -452,17 +456,6 @@ sensio_framework_extra:
router:
annotations: false
httplug:
clients:
wallabag:
factory: Wallabag\Helper\HttpClientFactory
config:
defaults:
timeout: 10
plugins: ['httplug.plugin.logger']
discovery:
client: false
# define custom entity so we can override length attribute to fix utf8mb4 issue
craue_config:
entity_name: Wallabag\Entity\InternalSetting

View File

@ -191,11 +191,17 @@ services:
tags:
- { name: doctrine.event_subscriber }
psr18.wallabag.client:
class: Symfony\Component\HttpClient\Psr18Client
arguments:
$client: '@Wallabag\HttpClient\WallabagClient'
Graby\Graby:
arguments:
$config:
error_message: '%wallabag.fetching_error_message%'
error_message_title: '%wallabag.fetching_error_message_title%'
$client: '@psr18.wallabag.client'
calls:
- [ setLogger, [ "@logger" ] ]
tags:
@ -205,9 +211,6 @@ services:
arguments:
$config: {}
wallabag.http_client:
alias: 'httplug.client.wallabag'
Wallabag\SiteConfig\GrabySiteConfigBuilder:
tags:
- { name: monolog.logger, channel: graby }
@ -216,11 +219,9 @@ services:
Wallabag\SiteConfig\SiteConfigBuilder:
alias: Wallabag\SiteConfig\GrabySiteConfigBuilder
GuzzleHttp\Cookie\CookieJar: ~
Wallabag\Helper\HttpClientFactory:
calls:
- ['addSubscriber', ['@Wallabag\HttpClient\Authenticator']]
Symfony\Component\BrowserKit\HttpBrowser:
arguments:
$client: '@browser.client'
RulerZ\RulerZ:
alias: rulerz