PHPackages                             phpflo/phpflo-fbp - 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. phpflo/phpflo-fbp

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

phpflo/phpflo-fbp
=================

fbp implementation for php

v1.2.0(9y ago)13.4k1[1 issues](https://github.com/phpflo/phpflo-fbp/issues)1MITPHPPHP &gt;=7.0.0

Since Sep 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/phpflo/phpflo-fbp)[ Packagist](https://packagist.org/packages/phpflo/phpflo-fbp)[ RSS](/packages/phpflo-phpflo-fbp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (7)Used By (1)

\[READONLY\] phpflo-fbp: load, parse, dump
==========================================

[](#readonly-phpflo-fbp-load-parse-dump)

Flowbased programming protocol (FBP) config file loader, using the FBP domain specific language (DSL).

[![Build Status](https://camo.githubusercontent.com/cd68d19d8484de72a29d5e6bca02807a6f38c21912b4d4ec6ba7e53673d2c281/68747470733a2f2f7472617669732d63692e6f72672f706870666c6f2f706870666c6f2d6662702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpflo)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b367138a4aa6407e2d21dea340733ac88d6c47d22ec15beeac8537bc5927110a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706870666c6f2f706870666c6f2d6662702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpflo/phpflo-fbp/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/ebfcf382bc37787336bd0420a0effff260c649180141dacdfc15f6e0d194dcc5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706870666c6f2f706870666c6f2d6662702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpflo/phpflo-fbp/?branch=master)[![License](https://camo.githubusercontent.com/e498eead712d82d9ee1af0a4850acd2e46ea48c48fb9ce5a3d2ab64f28f95b34/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e737667)](http://doge.mit-license.org)

Introduction
------------

[](#introduction)

This library allows you to load and parse configuration for your phpflo project. It also works standalone if you want to convert your old JSON configs to FBP spec. Supported config formats are JSON (.json), YAML (.yml) and FBP (.fbp), output is an object of type FbpDefinition. This allows you to output your parsed content in different formats, ranging from array over FBP, JSON to YAML.

Code Samples
------------

[](#code-samples)

Basic usage:

```
// load FBP config
$defintiion = PhpFlo\Loader\Loader::load('my/fbp/config/file.fbp');
```

You can load JSON, YAML and FBP that way.

Parser by itself:

```
$myFbpConfig =  IN Display(Output)
SplitbyLines() OUT -> IN CountLines(Counter)
CountLines() COUNT -> IN Display()
EOF;

$parser = new PhpFlo\Fbp\FbpParser();
$definition = $parser->run($myFbpConfig);
```

Dump your flow to a format:

```
$json = PhpFlo\Fbp\FbpDumper::toJson($definition);
$yaml = PhpFlo\Fbp\FbpDumper::toYaml($definition);
$fbp = PhpFlo\Fbp\FbpDumper::toFbp($definition);
```

The definition has following schema:

```
$schema = [
    'properties' => ['name' => '',],
    'initializers' => [
        [
            'data' => '',
            'tgt' => [
                'process' => '',
                'port' => '',
            ],
        ],
    ],
    'processes' => [
        'ReadFile' => [
            'component' => '',
            'metadata' => [
                'label' => '',
            ],
        ],
    ],
    'connections' => [
        [
            'src' => [
                'process' => '',
                'port' => '',
            ],
            'tgt' => [
                'process' => '',
                'port' => '',
            ],
        ],
    ],
]
```

### FBP DSL defintions

[](#fbp-dsl-defintions)

If you want to write definition files, here are the rules:

*General syntax*:

```
// ()  ->  ()
// examples
ReadFile(ReadFile) OUT -> IN SplitbyLines(SplitStr)
ReadFile() OUT -> IN SplitbyLines()
ReadFile() out[1] -> In[3] SplitbyLines()

```

- All elements are *case sensitive*
- The parentheses at the end of a process definition are mandatory (even if empty): `()`
- Process names are w+
- Port names can be \[a-zA-Z\_\]
- Each line determines a new chain of events, meaning at least two processes with two connecting ports, separated by a " -&gt; " like `()  ->  ()`
- Otherwise there is a ` ->  ()`

For better understanding, the whole RegEx used for definition examination is:

```
((?P[a-zA-Z_]+(\[(?P[0-9]+)\])?)\s)?((?P[\w\/]+)(\((?P[\w\/\\\.]+)?\))?)(\s(?P[a-zA-Z_]+(\[(?P[0-9]+)\])?))?

```

*Comments:*You can add comments and empty lines for better readability and documentation. If you have a comment in the first line, it will be used as name of the definition.

```
# this definition reads files and counts their lines
ReadFile() OUT -> IN SplitbyLines()
ReadFile() out -> In SplitbyLines()

# some comment

# and for readability :-)
ReadFile(ReadFile) OUT -> IN SplitbyLines(SplitStr)

```

*Initializer:*You can have initial values for a graph:

```
'test.file' -> IN ReadFile()

```

*Multiple definitions*: You can have a complete chain of definitions in one line to enhance visibility of a chain of events:

```
GreetUser() DATA -> OPTIONS Render() OUT -> STRING WriteResponse()

```

Installation
------------

[](#installation)

Regular install via composer:

```
composer require phpflo/phpflo-fbp
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~31 days

Recently: every ~37 days

Total

7

Last Release

3384d ago

Major Versions

v0.1.0 → v1.0.02016-09-25

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v1.2.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/113964?v=4)[Jason](/maintainers/asm)[@asm](https://github.com/asm)

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

---

Top Contributors

[![maschmann](https://avatars.githubusercontent.com/u/157620?v=4)](https://github.com/maschmann "maschmann (13 commits)")

---

Tags

flowfbp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpflo-phpflo-fbp/health.svg)

```
[![Health](https://phpackages.com/badges/phpflo-phpflo-fbp/health.svg)](https://phpackages.com/packages/phpflo-phpflo-fbp)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k51](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[altis/local-server

Local Server module for Altis

18221.6k3](/packages/altis-local-server)[phpflo/phpflo

Flow-based programming for PHP

2183.3k5](/packages/phpflo-phpflo)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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