Download the PHP package m1lt0n/in_great_state without Composer

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

InGreatState

An easy to use and flexible state machine.

InGreatState is a simple and very extensible state machine. It is not opinionated and it can be used in combination with ORMs, web frameworks or in standalone scripts.

Εxample

Assume you have an issue tracker. Issues can be in one of several states (e.g. open, wontfix, resolved, reopened etc). When transitioning from one state to the other, we want to do several things (e.g. send an email to the owner of the issue etc). An easy way to organize such actions are by using a state machine. An example of the example above could be:

This code will set the state of the issue to 'resolved' and also echo out the phrases:

The transition API is fluid and allows method chaining. If you want to add a transition from any initial state, you just specify the final state and actions like that:

The code above will match any transitions to wontfix from any initial state. Also note that all matching transitions actions will be triggered (i.e. execution does not stop when one matching transition is found, so you can have multiple transition registrations from open->closed etc).

An important note is that it is considered a good practice to throw exceptions in your closures in order to stop execution of the transitions and avoid inconsistent data to sneak into your application. Also, if you are persisting data in a database during transitions (and within your closures and/or your setState method), it's good to wrap your transition in a database transaction in order to rollback all changes and avoid inconsistent data structure.

The architecture is flexible enough accomodate any web framework or ORM integration and it's very easy to add features such as state logging (you can just store the state transitions in a database or even a flat file by implementing the functionality in the setState method of the stateful object). You are 100% in control!


All versions of in_great_state 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 m1lt0n/in_great_state contains the following files

Loading the files please wait ....