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

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

phpflo/phpflo
=============

Flow-based programming for PHP

v2.1.1(9y ago)2183.3k20[3 issues](https://github.com/phpflo/phpflo/issues)5MITPHPPHP &gt;=7.0.0CI failing

Since Sep 5Pushed 9y ago22 watchersCompare

[ Source](https://github.com/phpflo/phpflo)[ Packagist](https://packagist.org/packages/phpflo/phpflo)[ Docs](https://github.com/bergie/phpflo)[ RSS](/packages/phpflo-phpflo/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (5)

PhpFlo: Flow-based programming for PHP
======================================

[](#phpflo-flow-based-programming-for-php)

[![Build Status](https://camo.githubusercontent.com/b24ce69a8a599123b1d8f2afc4dc2ef937fb52864ac603473ab405422577dc29/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f706870666c6f2f706870666c6f2e706e67)](http://travis-ci.org/phpflo/phpflo)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/85604039ee14274459bc54629752a7fc263f352fd1f8acaa48934f421a2eb972/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706870666c6f2f706870666c6f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpflo/phpflo/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/63041cfcac9cfd32634cb89d2c9d3d4d16e482c6802bf65118a08fbc29298e38/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706870666c6f2f706870666c6f2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpflo/phpflo/?branch=master)[![License](https://camo.githubusercontent.com/e498eead712d82d9ee1af0a4850acd2e46ea48c48fb9ce5a3d2ab64f28f95b34/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e737667)](http://doge.mit-license.org)

PhpFlo is a simple [flow-based programming](http://en.wikipedia.org/wiki/Flow-based_programming) implementation for PHP. It is a PHP port of [NoFlo](https://noflojs.org), a similar tool for Node.js. From WikiPedia:

> In computer science, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.

Developers used to the [Unix philosophy](http://en.wikipedia.org/wiki/Unix_philosophy) should be immediately familiar with FBP:

> This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

It also fits well in Alan Kay's [original idea of object-oriented programming](http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en):

> I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).

The system has been heavily inspired by [J. Paul Morrison's](http://www.jpaulmorrison.com/) book [Flow-Based Programming](http://www.jpaulmorrison.com/fbp/#More).

PhpFlo is still quite experimental, but may be useful for implementing flow control in PHP applications.

Installing
----------

[](#installing)

PhpFlo can be installed from [Packagist.org](http://packagist.org/view/PhpFlo/PhpFlo) with the [composer](https://github.com/composer/composer) package manager. Just ensure your `composer.json` has the following:

```
php composer.phar require phpflo/phpflo
```

This gives you phpflo, [common](https://github.com/phpflo/phpflo-common), [fbp](https://github.com/phpflo/phpflo-fbp) and [flowtrace](https://github.com/phpflo/phpflo-flowtrace) packages, provided by a [monorepository](https://developer.atlassian.com/blog/2015/10/monorepos-in-git/). This helps us to manage the code in a easier way. Every package is also split as a separate repository on github and is installable by itself via packagist.

Autoloading
-----------

[](#autoloading)

To use PhpFlo, you need a [PHP Standards Group -compatible autoloader](http://groups.google.com/group/php-standards/web/psr-0-final-proposal). You can use the Composer-supplied autoloader:

```
