Download the PHP package smartgecko/governor-framework without Composer

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

Governor Framework PHP CQRS library

Build Status Scrutinizer Code Quality Code Coverage

Governor Framework is a Command and Query Responsibility Segregation library for PHP 5.5+.

It provides components to build applications following the CQRS patterns such as:

The main source of inspiration for this library was the Axon Framework written in Java and the Governor Framework can be viewed as a PHP port of the Axon, because it retains its basic building blocks.

The library can be directly integrated into the Symfony 2 framework as a bundle. The core of the Symfony 2 integration was taken from the LiteCQRS framework.

Quick Start

The Domain Model

To demonstrate the features of the Governor Framework we will work with a rather simple User model. The User class is our aggregate root. Aggregate roots in Governor must either implement the interface or extend one of the built in base classes:

In this example we will use the aggregate root with annotation support. Our aggregate will also serve as a command handler in this example.

The aggregate will react to the commands

which will produce the corresponding events

Our aggregate root implementation will look the following.

Commands and Events

We introduce 2 operations over the aggregate - one will create a new user and the second will change the user email. Notice the annotations on the event class - Governor Framework uses the excellent JMS serializer library for serialization and deserialization purposes. To allow event deserialization when rebuilding the aggregate from an event stream the annotations must be present in order to successfully deserialize the events.

Our commands and events are implemented like this:

Event listeners

We can register event listeners to listen for events on the event bus. The event listeners need to implement the interface.

This simple listener that will listen for all events on the event bus and print their payload.

Wrapping it all together

Now we can complete the example by setting up the necessary infrastructure in the following steps

  1. We need to set up a PSR-0 compatible logger like Monolog.
  2. Create a command bus and for convienience wrap it in a command gateway.
  3. Initialize an event store backed by a filesystem. Note that if you don't want to use event sourcing this step can be skipped.
  4. Set up a simple event bus
  5. Create an event sourcing repository
  6. Subscribe the annotated aggregate root to the command bus so it can recieve commands.
  7. Register an event listener that will display the content of our events.
  8. Dispatch commands.

Licensing

Governor Framework is licensed under the MIT license.


All versions of governor-framework with dependencies

PHP Build Version
Package Version
Requires rhumsaa/uuid Version @stable
psr/log Version @stable
php Version 5.5.*
symfony/proxy-manager-bridge Version >=2.4
ocramius/proxy-manager Version 0.5.*
monolog/monolog Version 1.8.0
hamcrest/hamcrest-php Version v1.1.1
videlalvaro/php-amqplib Version 2.2.*
predis/predis Version *
jms/serializer Version *
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 smartgecko/governor-framework contains the following files

Loading the files please wait ....