PHPackages                             sobi-labs/frameflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sobi-labs/frameflow

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sobi-labs/frameflow
===================

A lightweight, human-readable protocol for streaming payloads with metadata and integrity checks.

v0.1(1mo ago)02MITPHPPHP &gt;=8.4

Since Apr 16Pushed 1mo agoCompare

[ Source](https://github.com/SobiLabs/FrameFlow)[ Packagist](https://packagist.org/packages/sobi-labs/frameflow)[ RSS](/packages/sobi-labs-frameflow/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

FrameFlow
=========

[](#frameflow)

**A lightweight, human-readable streaming protocol for PHP 8.4+**

FrameFlow is designed for developers who need a robust way to stream data (payloads) accompanied by rich metadata. It bridges the gap between simple line-based logs and complex binary formats. It's built for speed, integrity, and absolute simplicity.

[![PHP Version](https://camo.githubusercontent.com/c890efdc823e3aced6f3fe5c4de13c54597c912ff089696b7c2fa8481c14207a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d3838393262662e7376673f7374796c653d666c61742d737175617265)](https://www.php.net/releases/8.4/en.php)[![License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

---

Key Features
------------

[](#key-features)

- **Human Readable:** Inspect your stream with a simple text editor.
- **Robust Integrity:** Automatic `sha256` checksums and `Payload-Length` headers for every frame.
- **Modern PHP 8.4:** Fully utilizes Property Hooks and Asymmetric Visibility for maximum performance and clean code.
- **Zero Dependencies:** No vendor bloat. Just pure, high-performance PHP.
- **Time-Ordered:** Built-in RFC 9562 compliant **UUIDv7** for natural sorting of messages.

---

The Protocol Structure
----------------------

[](#the-protocol-structure)

Each FrameFlow message consists of a global Header and one or more Frames.

```
--- FrameFlow-1.0 ---
Trace-Id: 000069d3-c5d9-7bb4-c757-48eb16eac000
Timestamp: 2026-04-09T22:40:25+00:00
Charset: utf-8
Version: 1
Checksum: sha256
Environment: Production
---

--- Frame ---
Id: 69d8017e8e6f2
Type: message
Payload-Length: 12
Checksum: f48... (sha256)
Payload:
Hello World!
---
```

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require sobi-labs/frameflow
```

Basic Usage
-----------

[](#basic-usage)

```
use FrameFlow\Message;
use FrameFlow\Encoder;

// 1. Create a message with global metadata
$message = Message::make();
$message->header->meta->add('Environment', 'Production');

// 2. Add frames (can be simple strings or Frame objects)
$message->add("This is the first part of my data.");
$message->add("And here is more content...");

$id = uniqid();
$frame = new Message\Frame($message->header, $id, 'notification', new Message\Meta([
    "Content-Type" => "text/html; charset=utf-8",
    "Action" => "ShowAlert",
]));
$frame->payload = "At least an HTML content";
$message->add($frame);

// 3. Encode to streamable string
echo Encoder::encode($message);
```

### Output

[](#output)

```
--- FrameFlow-1.0 ---
Trace-Id: 019d7423-cb85-714c-8f49-a58077393a47
Timestamp: 2026-04-09T21:26:36+00:00
Charset: utf-8
Version: 1
Checksum: sha256
Environment: Production
---

--- Frame ---
Id: 69d8198c287f2
Payload-Length: 34
Checksum: b6ed69fd1e91020ca3e251f91d8bdc07e60c5f8426aba34b06a502e5bfe13ae1
Payload:
This is the first part of my data.
---

--- Frame ---
Id: 69d8198c28805
Payload-Length: 27
Checksum: 3aabc50a531c0c9251c8419ce676c953395fd576ed6b9720503232a14198d6ad
Payload:
And here is more content...
---

--- Frame ---
Id: 69d8198c28808
Content-Type: text/html; charset=utf-8
Action: ShowAlert
Payload-Length: 35
Checksum: d32792d07b545c96fdefa95cd014ba79f4f4617131d0f9d632ad8d144754ca86
Payload:
At least an HTML content
---

```

Advanced Concepts
-----------------

[](#advanced-concepts)

### Property Hooks &amp; Metadata

[](#property-hooks--metadata)

FrameFlow uses PHP 8.4 property hooks. This means `size` and `checksum` are calculated on-the-fly only when needed, ensuring your data is always consistent without manual updates.

```
$frame = $message->get($id);
echo $frame->size;     // Returns byte length
echo $frame->checksum; // Returns current hash of payload
```

### Metadata Escaping

[](#metadata-escaping)

FrameFlow automatically handles multi-line metadata by escaping line breaks (`\n`, `\r`) during encoding. This ensures the protocol structure remains intact even with complex meta-information.

Specification Highlights
------------------------

[](#specification-highlights)

1. **Delimiters**: Blocks are separated by `---`.
2. **Metadata**: Key-Value pairs followed by a colon and a space.
3. **Payloads**: Prefixed by `Payload-Length` to allow safe binary data transmission.
4. **IDs**: Every frame has an ID. If not provided, FrameFlow generates sequential IDs for you.

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

Roadmap
-------

[](#roadmap)

The vision for **FrameFlow** is to provide a seamless, transparent way to stream data and metadata. Below is our strategic path forward:

Phase 1: Core &amp; PHP Ecosystem (Current)
-------------------------------------------

[](#phase-1-core--php-ecosystem-current)

- Base data structures (Message, Frame, Meta)
- RFC 9562 compliant UUIDv7 integration (Zero-Dependency)
- PHP 8.4 high-performance Encoder
- **Next:** High-performance PHP Decoder (Streaming Parser)
- Comprehensive PHPUnit test suite (Aiming for 100% code coverage)
- Static analysis integration (PHPStan/Psalm)

Phase 2: Cross-Language Support
-------------------------------

[](#phase-2-cross-language-support)

- **JavaScript/TypeScript Client:** A browser-compatible decoder for `fetch()` and WebStreams API.
- **Cross-Platform Specs:** Formalization of the FrameFlow specification for third-party implementations.
- **Go/Rust Ports:** High-performance implementations for microservice environments.

Phase 3: Advanced Features
--------------------------

[](#phase-3-advanced-features)

- **Binary Frames:** Optimized handling for raw binary data to minimize encoding overhead.
- **Compression:** Optional frame-level compression (e.g., zstd, gzip).
- **Encryption:** Native support for AEAD (Authenticated Encryption with Associated Data) at the frame level.

Built with ☕ and ❤️ for the modern PHP ecosystem.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e46ca25083341584625ea4c1cb3131812ee9020d172d4682a44541787535690b?d=identicon)[Cante](/maintainers/Cante)

---

Top Contributors

[![Cante](https://avatars.githubusercontent.com/u/11178095?v=4)](https://github.com/Cante "Cante (1 commits)")

### Embed Badge

![Health badge](/badges/sobi-labs-frameflow/health.svg)

```
[![Health](https://phpackages.com/badges/sobi-labs-frameflow/health.svg)](https://phpackages.com/packages/sobi-labs-frameflow)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k116.2M670](/packages/symfony-maker-bundle)[consolidation/site-process

A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.

5347.3M9](/packages/consolidation-site-process)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
