mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 15:46:52 +03:00
Added recipe for Buzz 1.0
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# 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.multi_curl'
|
||||
Buzz\Client\BatchClientInterface: '@buzz.client.multi_curl'
|
||||
|
||||
# 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 }
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> Get started with Buzz </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
* Buzz is great for sending PSR-7 requests. To get started you need to install
|
||||
a PSR-7 implementation and a PSR-17 factory. There are many to choose from.
|
||||
To quickly get started run <info>composer require nyholm/psr7</info>
|
||||
Reference in New Issue
Block a user