Download the PHP package robrogers3/commandbus without Composer

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

CommandBus

Latest Version on Packagist Build Status Total Downloads

This a CommandBus implementation for php5.3. It's based on illuminate/events. This though will require a few other packages: illuminate/support, illuminate/contracts, and illuminate/container.

A CommandBus allows you to leverage commands and domain events in your php projects.

Essentially, the value add is to replace lines and lines of procedural style code in a class or method, with classes that do one thing. These classes are loosely coupled together through eventing initiated by the CommandBus and CommandHandlers.

The usage shown below is the best explanation.

Install

Via Composer

Usage

Requirements:

You have an app which uses illimunate packages. Especially illimunate/events.

Your Goal:

Have a way to accomplish some task which takes many subtasks. Perhaps currently you have the subtasks inside one class or even just one method. Some kind of God Object.

The Solution:

Use a command bus to kick off (dispatch) the necessary classes to complete accomplish what was done in one place.

Initial Setup:

You need to create a boot method or function that initialize the illuminate Container (IOC). This method should:

  1. Define your listeners

  2. In your boot method, register them:

Get to Work

1) Create your command. It's a simple class, a DTO of sorts. This is what gets thrown into the commandbus. Here is a simple one

2) Next, lets create a listener, like:

3) Create your command handler. The commandbus calls the handle method on this class.

4) Finally create the 'event' we are listening for. This also a DTO, which contains the above UserRegister $command.

5) Use it:

6) See what happens:

If you have registered the three listeners above, they all get fired.

Bottom line in your controller, or wherever. You just need 3 lines:

For the three tasks above, it's not a big deal to call them directly. But if you have many many things to do, then it cleans things up rather nicely.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of commandbus with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
illuminate/support Version >=4.1 < 5.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 robrogers3/commandbus contains the following files

Loading the files please wait ....