2017 © Pedro Peláez
 

library php-graflow

A simple node flow controller

image

limen/php-graflow

A simple node flow controller

  • Wednesday, January 31, 2018
  • by limen
  • Repository
  • 0 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Graflow

Build Status Packagist, (*1)

A simple flow controller with features, (*2)

  • A flow is defined by a graph.
  • A graph is consisted of nodes and edges.
  • Edges have direction.
  • A graph can have one head node and one or multiple tail nodes.
  • A middle node is a node who is neither head node nor tail node.
  • A tail node can have one or multiple in nodes and have no out node.
  • A head node can have one or multiple out nodes and have no in node.
  • A middle node can have one or multiple in node and one or multiple out nodes.
  • The edge between two adjacent nodes could be one way or two way.

Install

Recommend to install via composer., (*3)

composer require "limen/php-graflow"

Usage

see src/Examples and tests/, (*4)

Concepts

In/Out node

When node A has way to node B, A is B's in node and B is A's out node., (*5)

Contract

Define a graph in PHP array

The first key must be the head node., (*6)

[
    'blank' => ['editing', 'canceled'],
    'editing' => ['draft', 'canceled'],
    'draft' => ['editing', 'published', 'canceled'],
    'published' => ['draft', 'printed', 'canceled'],
    'printed' => [],
    'canceled' => [],
]

The equivalent graph, (*7)

graph, (*8)

The arrow shows the way direction., (*9)

The Versions

31/01 2018

dev-master

9999999-dev https://github.com/limen/php-graflow

A simple node flow controller

  Sources   Download

MIT

The Requires

 

The Development Requires

workflow state-machine