mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-19 02:56:26 +03:00
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
# Read more about client options at: https://github.com/kriswallsmith/Buzz/blob/master/doc/client.md
|
|
services:
|
|
_defaults:
|
|
public: false
|
|
|
|
# Tell the auto wire system to use "FileGetContents" client as default client.
|
|
# Set this to any of the other clients below (e.g. Curl or MultiCurl) to use a different default client.
|
|
Buzz\Client\BuzzClientInterface: '@buzz.file_get_contents_client'
|
|
|
|
# Clients
|
|
buzz.file_get_contents_client:
|
|
class: Buzz\Client\FileGetContents
|
|
arguments:
|
|
- timeout: 10
|
|
|
|
buzz.curl_client:
|
|
class: Buzz\Client\Curl
|
|
arguments:
|
|
- timeout: 10
|
|
|
|
buzz.multi_curl_client:
|
|
class: Buzz\Client\MultiCurl
|
|
arguments:
|
|
- timeout: 10
|
|
|
|
# Browser
|
|
Buzz\Browser:
|
|
arguments: ['@Buzz\Client\BuzzClientInterface']
|
|
calls:
|
|
- ['addMiddleware', ['@buzz.middleware.content_length']]
|
|
- ['addMiddleware', ['@buzz.middleware.logger']]
|
|
|
|
# Middlewares
|
|
buzz.middleware.content_length:
|
|
class: Buzz\Middleware\ContentLengthMiddleware
|
|
|
|
buzz.middleware.logger:
|
|
class: Buzz\Middleware\LoggerMiddleware
|
|
arguments: ['@?logger']
|
|
tags:
|
|
- { name: monolog.logger, channel: buzz }
|