leric/php-thrift
Apache Thrift PHP library for building cross-language RPC clients and servers. Includes generated PHP types, TBinaryProtocol serialization, PSR-4 class loading, and optional APCu caching for sockets. Requires PHP 5+.
Types.php / Service.php classes serialize on the wire.thrift/lib/php/lib).vendor_manual/, adopting this is a small but real maintainability decision: version pinning, composer.lock provenance, autoloading consistency with the rest of the app.Adopt when:
thrift compiler in your build pipeline to generate PHP bindings.TSocket, TBufferedTransport, TBinaryProtocol, TProtocolException, server types) that generated code requires but does not include.Look elsewhere when:
thrift binary in CI, this package is inert.Note on the adoption metric: "0 dependents" likely undercounts reality — Thrift's own README tells users to copy the library into their codebase, so much real usage is invisible to package registries. Still, plan for solo operation.
For executives (one paragraph): This is a small, free connector that lets one of our PHP applications talk to systems that already speak Thrift — the protocol our platform services use. It avoids either (a) rebuilding the PHP app on a different stack or (b) standing up a new translation service. Cost is effectively zero and it ships in days, not a quarter. The honest caveat: it's a low-maintenance, low-activity open-source package, so we should treat it as code we own — pin the version, review it once, and keep the eventual move to our standard RPC stack on the roadmap rather than treating this as a long-term platform bet.
For engineering leads:
It's the Composer-packaged Apache Thrift PHP runtime — not a framework, not an SDK. You still need the thrift compiler and your team's IDL to generate Types.php and Service.php; this package provides the transport and protocol classes those files depend on. It replaces vendoring lib/php/lib by hand. Assume the README's PHP 5 orientation is accurate until proven otherwise: smoke-test the generated bindings on our PHP version in a spike before we size the work. Plan to pin an exact version in composer.lock, mirror the repo internally, and budget a day or two for a read-through — that's the whole ongoing cost. If the spike fails, the fallback is vendoring Apache Thrift's PHP library directly, which is the same code with worse ergonomics.
Decision requested: approve as a tactical dependency for the specific integration, not as a standards-track choice; no dedicated headcount, one-time review, and an explicit exit path to gRPC if the platform roadmap goes that direction.
How can I help you explore Laravel packages today?