Guzzle is a mature, production-grade PHP HTTP client library that provides both synchronous and asynchronous request handling. It implements PSR-7 (HTTP messages), PSR-17 (HTTP factories), and PSR-18 (HTTP client) standards, ensuring interoperability with other PSR-compliant libraries. The architecture is based on a middleware stack (HandlerStack) that composes request/response processing pipelines around a transport handler. Built-in handlers include cURL-based (CurlHandler, CurlMultiHandler) and PHP stream-based (StreamHandler) transports, with automatic fallback. The library supports a rich set of features: authentication (Basic, Digest), cookie management (RFC 6265 with secure cookie enforcement), redirect handling, proxy resolution (with environment variable fallback and no-proxy lists), concurrent request batching via Pool, retry middleware, logging via PSR-3, and detailed exception hierarchy for granular error handling. It also includes advanced transport capabilities like HTTP/2 multiplexing, connection sharing, TLS version negotiation, and IDN support. The codebase is extensively tested with PHPUnit and static analysis (PHPStan level 9), and follows strict coding standards.
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.
This repository is a PHP client library for the Mautic marketing automation REST API. It provides a clean, object-oriented interface for performing CRUD and custom operations on Mautic entities such as contacts, campaigns, emails, segments, and companies. The library is built on PSR-18 (HTTP client) and PSR-7 (HTTP messages) abstractions, making it compatible with any modern PHP HTTP client via php-http/discovery. It supports three authentication methods: OAuth 1.0a, OAuth 2.0, and BasicAuth, each handling token lifecycle and refresh automatically. The architecture follows a factory pattern: the `MauticApi` class instantiates context-specific API classes (e.g., `Contacts`, `Emails`) that extend a common `Api` base class. The base class implements generic `get()`, `getList()`, `create()`, `edit()`, `delete()`, and batch operations, while context classes add custom endpoints (e.g., `addContact()` for campaigns). A fluent `QueryBuilder` allows building complex WHERE/ORDER/SELECT clauses for list requests. The library also includes a backwards-compatibility layer that transparently falls back to deprecated API URLs when a 404 is returned. External dependencies include any PSR-18 HTTP client implementation (e.g., Guzzle, Symfony HttpClient) and a PSR-3 logger (optional). The library is designed for integration into PHP applications that need programmatic access to Mautic data. It includes a legacy web-based API tester (`apitester/`) for manual testing, which vendors Bootstrap 3.2.0 and jQuery. The test suite requires a live Mautic instance and is run in CI against temporary installations. While the core library is modern and well-structured, the apitester UI is outdated and the backwards-compatibility layer introduces some technical debt. Overall, this is a solid, production-ready API client with good separation of concerns and reusable patterns.