infocyph / talkingbytes
Protocol-focused communication toolkit for PHP.
2.0.0
2026-08-13 11:48 UTC
Requires
- php: >=8.4
- ext-curl: *
- ext-fileinfo: *
- ext-openssl: *
Requires (Dev)
- infocyph/phpforge: dev-main@dev
Suggests
- ext-grpc: Required for native gRPC transport.
- ext-iconv: Optional fallback for inbound charset conversion when mbstring is unavailable.
- ext-imap: Optional for imap_* address parsing and UTF7-IMAP fallback helpers.
- ext-mbstring: Recommended for robust charset conversion and encoded header handling.
- ext-sodium: Required for Ed25519-SHA256 DKIM signing and verification.
- grpc/grpc: Required for generated PHP gRPC clients.
README
Protocol-focused communication toolkit for PHP.
TalkingBytes provides typed HTTP and gRPC pipelines, shared result/event primitives, and protocol modules for:
- Email (SMTP/sendmail/mail/spool + IMAP/POP3/parser)
- HTTP (cURL + cURL multi)
- Webhook (sign/verify/replay)
- gRPC (adapter + retry + fake caller)
Install
composer require infocyph/talkingbytes
Requirements:
- PHP
^8.4 ext-curlext-fileinfoext-openssl
Quick Start
HTTP
use Infocyph\TalkingBytes\Http\HttpClient; $result = HttpClient::curl() ->withBearerToken($token) ->timeout(10) ->postJson('https://api.example.com/orders', [ 'order_id' => 1001, 'amount' => 500, ]); if ($result->successful) { $data = $result->response->json(); }
use Infocyph\TalkingBytes\Email\Email; use Infocyph\TalkingBytes\Email\EmailMessage; $result = Email::sender()->usingNull()->send( EmailMessage::new() ->from('sender@example.com') ->to('user@example.com') ->subject('Hello') ->text('Hello from TalkingBytes') );
Webhook
use Infocyph\TalkingBytes\Webhook\Webhook; use Infocyph\TalkingBytes\Webhook\WebhookMessage; $delivery = Webhook::sender($httpClient) ->withSecret('whsec_test') ->send( WebhookMessage::event('order.created') ->url('https://merchant.example.com/webhook') ->payload(['order_id' => 1001]) );
gRPC
use Infocyph\TalkingBytes\Grpc\GrpcClient; use Infocyph\TalkingBytes\Grpc\Receiver\GrpcInboundRequest; use Infocyph\TalkingBytes\Grpc\Receiver\GrpcInboundResponse; use Infocyph\TalkingBytes\Grpc\Sender\GrpcRequest; use Infocyph\TalkingBytes\Grpc\Sender\GrpcResponse; use Infocyph\TalkingBytes\Grpc\GrpcInboundDispatcher; use Infocyph\TalkingBytes\Grpc\GrpcStatus; $client = GrpcClient::using( static fn (GrpcRequest $request): GrpcResponse => new GrpcResponse(GrpcStatus::Ok, ['ok' => true, 'echo' => $request->message]), ); $result = $client->send(new GrpcRequest('/orders.v1.OrderService/Create', [ 'order_id' => 1001, ])); $server = GrpcInboundDispatcher::new()->withHandler( '/orders.v1.OrderService/Create', static fn (GrpcInboundRequest $request): GrpcInboundResponse => GrpcInboundResponse::ok(['received' => $request->message]), );
Security
Do not disclose suspected vulnerabilities in a public issue, discussion or pull request. Follow SECURITY.md and use GitHub private vulnerability reporting.
TalkingBytes is protected by PHPForge, which provides automated tests, static and taint analysis, dependency auditing, architecture checks and release-readiness gates. Automated controls do not replace responsible disclosure or manual review.
Made with ❤️ for the PHP communityMIT Licensed
Documentation • Security • Code of Conduct • Contributing
🗂️ Bug • Feature • Documentation • Question • CI failure
🔀 General • Bug fix • Feature • Refactor • Performance • Security & reliability • Documentation • Maintenance