$ show kriswallsmith/Buzz
Buzz is a lightweight, PSR-18-compatible PHP HTTP client library providing three transports: FileGetContents, Curl, and MultiCurl. The MultiCurl client supports both asynchronous requests and HTTP/2 server push. Architecture follows a middleware chain pattern through the `Browser` class, which wraps any client and allows request/response modification via pluggable middleware. Built-in middleware covers authentication (Basic, Bearer, Digest, WSSE), cookie management, content-length, content-type auto-detection, request logging, and history recording. The library integrates with Symfony OptionsResolver for configuration validation and supports PSR-7, PSR-17, and php-http/httplug interfaces. It is a mature, stable library primarily in maintenance mode but still receiving compatibility updates and bug fixes.
The LLM identified 4 files worth highlighting for reuse:
Constructs a PSR-7 ResponseInterface from raw HTTP response data (status line, headers, body). Encapsulates parsing logic for status codes, headers, and streaming body content. Accepts any PSR-17 ResponseFactoryInterface, making it decoupled. Reusable in any PHP project that needs to build a PSR-7 response from a raw HTTP wire format, e.g., in custom proxy servers or when handling curl responses.
Static utility to convert between Buzz-style headers (array of 'Key: value' strings) and PSR-7 headers (associative array with string key and array of values). Self-contained and dependency-free. Useful in any project that works with multiple HTTP header representations, such as when adapting legacy code or writing custom HTTP clients.
Immutable key-value store with a specialized `add()` method that correctly merges 'curl' option arrays (replacing sub-keys rather than whole array). Implements IteratorAggregate and Countable. Provides `get()`, `has()`, `keys()`, `all()`. Can be extracted and reused as a general-purpose immutable parameter container in any PHP application.
Manages HTTP cookies across requests: stores, retrieves, adds cookie headers to outgoing requests, processes Set-Cookie headers from responses, and removes expired cookies. Depends only on PSR-7 interfaces and the Cookie class. Reusable as a standalone cookie jar for any PHP HTTP client implementation that follows PSR-7.