Pheanstalk is a pure PHP 8.3+ client library for the beanstalkd work queue, providing a fully typed, object-oriented interface for producing, consuming, and managing jobs. The library is split into three role-specific interfaces (Publisher, Subscriber, Manager) with a unified Pheanstalk class for convenience. It supports multiple socket implementations (stream, socket, fsockopen) and features a command pattern where each beanstalkd protocol command is encapsulated as a value object that both builds the protocol line and interprets the response. The codebase is heavily tested (unit and integration), follows strict coding standards, and uses modern PHP features including enums, readonly properties, and generics-compatible interfaces. Key architectural highlights include a reusable socket abstraction, immutable value objects for job IDs and tube names, and a clean connection layer that handles reconnection and error recovery. The library is actively maintained with automated CI, semantic releases, and static analysis at PHPStan level 9.
This is a PHP library for interacting with MikroTik RouterOS devices via their proprietary API protocol. It provides a clean, object-oriented client that manages TCP socket connections (optionally over SSL), handles authentication with both legacy (pre-6.43) and modern login schemes, and supports executing arbitrary RouterOS commands. The library also includes an SSH-based export feature using the spatie/ssh package. The codebase is well-structured with clear separation of concerns: a Config class for connection parameters, a Query class for building API commands, a Client class for sending queries and reading responses, and low-level stream abstractions (ResourceStream, StringStream) for I/O. The APILengthCoDec class is a notable component that correctly implements the binary length encoding used in the RouterOS wire protocol. The repository includes a Laravel service provider and facade for easy integration. While the library is functionally complete and has been used in production (503 stars, 180 forks), the original author has explicitly stated it is unmaintained, and the project shows signs of technical drift (e.g., outdated spatie/ssh dependency, PHP 8.4 compatibility workarounds). The code remains a solid example of a specialized API client with good engineering practices.