Download the PHP package jagarsoft/php-state-machine without Composer

On this page you can find all versions of the php package jagarsoft/php-state-machine. 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 php-state-machine

PHP State Machine

StateMachine Logo

Scrutinizer Code Quality Code Coverage Build Status Packagist Downloads language PHP GPL license Badges shields.io

What is a State Machine?

It's a data structure made of two key items:

Transitions go from an initial state to a destination state fired by events.

You can view a State Machine as a graph like this ^1:

State diagram for a turnstile

Also, you can think about it, as a double-entry array or State Transition Table indexed by current state and current event. Content will be the next state ^1:

Bound to the next state, you can set a action function that will be executed when event will be raised at the current state, after run, the new state will be set. In foremention example, output may be the action performed by bound function over some servomotor or something like that (save data, etc).

You can cancel the transition to the next state invoking cancelTransition within action function. Current state will be remain.

Action functions are atomic. If you fire new events in an action function, they will be enqueued, and their action functions, if any, will be invoked consecutively, every time action function return.

If you cancel transition within a nested event, subsequent events may fail if no alternative event is defined for the current state.

Unexpected events for the current state will throw an exception.

You can fire common event from any state, by defining a addCommonTransition with expected event and destination state only, but you must add all states yet.

Installing

By Composer, just issue next command:

Getting started

Output:

Features

StateMachine gives you the followings features:

  1. You can prove a event before it be fired
  2. You can execute a guard in order to cancel transition
  3. You can execute a function before and/or after action
  4. You can create StateMachine from Array or Winzou config
  5. You can store extra data in transition

Coming soon... you will be able to create StateMachine from other sources, for instance, DOT definition. StateMachine so created is fully functional and will respond to their events. Moveover, you will be able to save your current StateMachine to that format too.

Licence

GNU General Public License v2.0 only


All versions of php-state-machine with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
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 jagarsoft/php-state-machine contains the following files

Loading the files please wait ....