Skip to content

jeyroik/deprecated-sm-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This package is deprecated!

Do not use it!

extas-m

EXTendable State Machine

Stage flow see here: http://extas.jeyroik.ru (RU lang)

install

composer require jeyroik/extas-m:*

usage

  • define generic plugins
  • define all other plugins
  • define machine config
  • define dispatchers for your states (or you can use built-in dispatchers for test aims)
  • run machine
$config = [...]; // or dsn if you have db generic plugins
$extas = new jeyroik\extas\components\systmes\states\StateMachine($config);
$extas->run();

If you are using State route plugin (by default), you can see states route:

echo '<pre>';
print_r($extas->getRoute());
echo '</pre>';

extending state machine

Extas let you extend it by two dimensions:

  • functionality
  • stages triggering

Stages - they are like events, you can react on stage when it is reached.

Functionality - this is built-in opportunity for extending exactly objects interface without needs to extends them physically by class extending. This is reached by extensions.

plugins

  • create you plugin
  • require it to you project

extensions

  • create extension
  • require it to your project