I'm looking to implement user state / workflow handling in a PHP application.
Currently have:
- a user based system with around 10 different states any user can be in (enabled, disabled, pre-registered, de-registered, deleted etc.)
- defined rules regarding from which state to which a user can go based on different system events
- a rather messy (but mostly working) system full of IFs and SWITCHes scattered all across the place
Want to:
- replace the current IFfy user state handling with a "clever" state machine that would allow to define those user transition rules
- allow to visualise those defined rules
- make the system more secure and bullet proof by making sure the user can only be in legal states
My research:
I checked both SO and other places for a PHP implementation of workflow and state machines and promising candidates seem to be
- The PEAR FSM http://www.indelible.org/php/FSM/guide.html
- or the eZ componenet Workflow http://ezcomponents.org/docs/api/trunk/introduction_Workflow.html
I'd be grateful for any comments regarding any experience with working with either of the libraries above and / or opinion regarding suitability for what I need or for hints to other places where to look to.