Download the PHP package tmilos/light-fsm without Composer

On this page you can find all versions of the php package tmilos/light-fsm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package light-fsm

Light FSM

License Build Status Coverage Status HHVM Status Scrutinizer Code Quality SensioLabsInsight

Finite-state machine FSM PHP library. Create state machines and lightweight state machine-based workflows directly in PHP code.

This project, as well as the example above, was inspired by stateless.

Features

Firing trigger events with additional data

Event can be fired with additional data StateMachine::fire($event, $data) that will be passed and available to entry/exit and guard listeners, so they can base their logic based on it.

Hierarchical States

In the example below, the ON_HOLD state is a substate of the CONNECTED state. This means that an ON_HOLD call is still connected.

In addition to the StateMachine::getCurrentState() method, which will report the precise current state, an isInState($state) method is also provided. isInState($state) will take substates into account, so that if the example above was in the ON_HOLD state, isInState(State::CONNECTED) would also evaluate to true.

Entry/Exit Events

In the example, the startTimer() method will be executed when a call is connected. The stopTimer() will be executed when call completes.

When call moves between the CONNECTED and ON_HOLD states, since the ON_HOLD state is a substate of the CONNECTED state, these listeners can distinguish substates and note that call is still connected based on the first $isSubState argument.

External State Storage

In order to listen for state changes for persistence purposes, for example with some ORM tool, pass the listener callback to the StateMachine constructor.

In this case, when StateMachine is constructed with two callbacks, the state is held totaly external, and each time StateMachine needs current state, the first callback will be called, and each time the state changes, the second callback will be called.

Introspection

The state machine can provide a list of the trigger events than can be successfully fired within the current state by the StateMachine::getPermittedTriggers() method.

Guard Clauses

The state machine will choose between multiple transitions based on guard clauses, e.g.:

Export to DOT graph

It can be useful to visualize state machines on runtime. With this approach the code is the authoritative source and state diagrams are by-products which are always up to date.

The StateMachine::toDotGraph() method returns a string representation of the state machine in the DOT graph language, e.g.:

This can then be rendered by tools that support the DOT graph language, such as the dot command line tool from graphviz.org or viz.js. See (http://www.webgraphviz.com) for instant gratification. Command line example to generate a PDF file:


All versions of light-fsm with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tmilos/light-fsm contains the following files

Loading the files please wait ....