From dea573f82ca8f888d56d5cc877e6fee164a2df1c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 28 Dec 2018 10:03:55 +0100 Subject: [PATCH 1/3] Added recipe for Buzz 1.0 --- .../buzz/1.0/config/packages/buzz.yaml | 48 +++++++++++++++++++ kriswallsmith/buzz/1.0/manifest.json | 5 ++ kriswallsmith/buzz/1.0/post-install.txt | 7 +++ 3 files changed, 60 insertions(+) create mode 100644 kriswallsmith/buzz/1.0/config/packages/buzz.yaml create mode 100644 kriswallsmith/buzz/1.0/manifest.json create mode 100644 kriswallsmith/buzz/1.0/post-install.txt diff --git a/kriswallsmith/buzz/1.0/config/packages/buzz.yaml b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml new file mode 100644 index 00000000..335435f6 --- /dev/null +++ b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml @@ -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 } diff --git a/kriswallsmith/buzz/1.0/manifest.json b/kriswallsmith/buzz/1.0/manifest.json new file mode 100644 index 00000000..e164c6e6 --- /dev/null +++ b/kriswallsmith/buzz/1.0/manifest.json @@ -0,0 +1,5 @@ +{ + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} diff --git a/kriswallsmith/buzz/1.0/post-install.txt b/kriswallsmith/buzz/1.0/post-install.txt new file mode 100644 index 00000000..caaf2b70 --- /dev/null +++ b/kriswallsmith/buzz/1.0/post-install.txt @@ -0,0 +1,7 @@ + + Get started with Buzz + + + * 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 composer require nyholm/psr7 \ No newline at end of file From fe33b70cda5ab516a2bb516c6888bd2f37457d70 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 28 Dec 2018 10:08:16 +0100 Subject: [PATCH 2/3] cs --- kriswallsmith/buzz/1.0/config/packages/buzz.yaml | 15 +++++++++------ kriswallsmith/buzz/1.0/post-install.txt | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kriswallsmith/buzz/1.0/config/packages/buzz.yaml b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml index 335435f6..c9b5df67 100644 --- a/kriswallsmith/buzz/1.0/config/packages/buzz.yaml +++ b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml @@ -13,22 +13,25 @@ services: class: Buzz\Client\FileGetContents arguments: - '@Psr\Http\Message\ResponseFactoryInterface' - - timeout: 10 - allow_redirects: false + - + timeout: 10 + allow_redirects: false buzz.client.curl: class: Buzz\Client\Curl arguments: - '@Psr\Http\Message\ResponseFactoryInterface' - - timeout: 10 - allow_redirects: false + - + timeout: 10 + allow_redirects: false buzz.client.multi_curl: class: Buzz\Client\MultiCurl arguments: - '@Psr\Http\Message\ResponseFactoryInterface' - - timeout: 10 - allow_redirects: false + - + timeout: 10 + allow_redirects: false # Browser Buzz\Browser: diff --git a/kriswallsmith/buzz/1.0/post-install.txt b/kriswallsmith/buzz/1.0/post-install.txt index caaf2b70..3670b3d0 100644 --- a/kriswallsmith/buzz/1.0/post-install.txt +++ b/kriswallsmith/buzz/1.0/post-install.txt @@ -4,4 +4,4 @@ * 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 composer require nyholm/psr7 \ No newline at end of file + To quickly get started run composer require nyholm/psr7 From 05bb9f163b79979712fe6c6cc16a4786a371811d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 29 Dec 2018 15:18:12 +0100 Subject: [PATCH 3/3] Minor --- kriswallsmith/buzz/1.0/config/packages/buzz.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kriswallsmith/buzz/1.0/config/packages/buzz.yaml b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml index c9b5df67..64fe575c 100644 --- a/kriswallsmith/buzz/1.0/config/packages/buzz.yaml +++ b/kriswallsmith/buzz/1.0/config/packages/buzz.yaml @@ -5,9 +5,12 @@ services: # 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\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