-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
buzz.yaml
54 lines (46 loc) · 1.79 KB
/
buzz.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 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.client.file_get_contents'
Buzz\Client\BatchClientInterface: '@buzz.client.multi_curl'
# Register alias for PSR-18
Psr\Http\Client\ClientInterface: '@Buzz\Client\BuzzClientInterface'
# Clients
buzz.client.file_get_contents:
class: Buzz\Client\FileGetContents
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
buzz.client.curl:
class: Buzz\Client\Curl
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
buzz.client.multi_curl:
class: Buzz\Client\MultiCurl
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
# Browser
Buzz\Browser:
arguments: ['@Buzz\Client\BuzzClientInterface', '@Psr\Http\Message\RequestFactoryInterface']
calls:
- ['addMiddleware', ['@buzz.middleware.content_length']]
- ['addMiddleware', ['@buzz.middleware.logger']]
# Middleware
buzz.middleware.content_length:
class: Buzz\Middleware\ContentLengthMiddleware
buzz.middleware.logger:
class: Buzz\Middleware\LoggerMiddleware
arguments: ['@?logger']
tags:
- { name: monolog.logger, channel: buzz }