Download the PHP package mikemix/tactician-module without Composer

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

Tactician Laminas/Mezzio Module

Wrapper module for easy use of the Tactician Command Bus in your Laminas or Mezzio applications.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License

Installation

Best install with Composer:

Register as Laminas Framework module inside your file using TacticianModule name.

You can also use this package as Mezzio module by TacticianModule\ConfigProvider

Using

The module presents a Controller Plugin called tacticianCommandBus() for easy use of dispatching commands. If no command object is passed to it, the CommandBus object will be returned. If you pass the command however, it will be passed over to the CommandBus and handled, and the output from the handler will be returned.

You can type hint this plugin in your controller, for example: .

You can inject the CommandBus into yout service layer through a factory by simply requesting the League\Tactician\CommandBus::class from the Container.

Configuring

The module ships with a LaminasLocator and a CommandHandlerMiddleware and a HandlerInflector configured as default. If you wish to override the default locator or default command bus implementations, then simply use the tactician key in the merged config.

default-extractor, default-locator and default-inflector are service manager keys to registered services.

LaminasLocator expects handlers in the handler-map to be commandName => serviceManagerKey or commandName => Handler_FQCN, altough to prevent additional costly checks, use serviceManagerKey and make sure it is available as a Laminas Service.

To add custom middleware to the middleware stack, add it to the middleware array as ServiceName => priority in which the middleware are supposed to be executed (higher the number, earlier it will execute). For example

Basic usage

Basicly, all you probably will want to do, is to define the handler-map array in your module's configuration. For example:

Plugins

LockingMiddleware

The LockingMiddleware can now be used out of the box. Simply add the League\Tactician\Plugins\LockingMiddleware FQCN to the TacticianModule's middleware configuration with appropriate priority. You probably want to execute it before the CommandHandlerMiddleware:

TransactionMiddleware

The TransactionMiddleware can now be used out of the box. Simply add the League\Tactician\Doctrine\ORM\TransactionMiddleware FQCN to the TacticianModule's middleware configuration with appropriate priority. You probably want to execute it before the CommandHandlerMiddleware and after the LockingMiddleware:

Changing the Handler Locator

ClassnameLaminasLocator

This locator simply appends the word Handler to the command's FQCN so you don't have to define any handler map. For example, if you request command App\Commands\LoginCommand, locator will try to get App\Command\LoginCommandHandler from the Service Manager.

Locator will work with FQCN's not registered in the Service Manager, altough to prevent additional costly checks, make sure the locator is registered as a invokable or factory.

To change the locator from LaminasLocator to ClassnameLaminasLocator simply set it in the config:


All versions of tactician-module with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8.0
league/tactician Version ^1.0
psr/container Version ^1.0 || ^2.0
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 mikemix/tactician-module contains the following files

Loading the files please wait ....