Download the PHP package pavelmics/yii-tactician without Composer

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

Yii-Tactician

Yii-Tactician is yii addapter for Tactician command bus library. It provides an easy way to use the command bus pattern in Yii-based apps.

Installation

You can install Yii-Tactician via composer by running composer require pavelmics/yii-tactician or just add "pavelmics/yii-tactician": "0.1.1" to your composer.json file.

Configuration

Once the library is installed, modify your application configuration as follows:

By default Yii Tactician uses bus_commands directory for storing command handlers, you can change this by configuring handlersPath with array of yii-aliases as follow:

NOTE: don't use * aliases, your aliases must point to a dirrectory but not a file! NOTE2: Also you have to use psr-4 autoload system to use Yii-Tactician (just add require('path/to/vendor/autoload.php'); to your index.php and console.php).

Usage

Basic

Define a command class somewhere in your application, for example:

Then, define a handler class under one of your handlers path (see configuration section of this readme). The name of handler class must be the same as the name of command class suffixed with "Handler". For example for class TestCommand we need to define TestCommandHandler class:

Now we can use this command in controllers (or wherever you want):

Controller based handlers

Sometimes we need handle one command in several different ways. Let's say we need to register users. Sometimes users register by email and sometimes by phone number. We need to handle register command almost the same but at the same time a bit different. To achive this we can define several handler-functions in handler class (like in standart Yii controller). For example:

And then use YiiTactician\ControllerBaseCommand to define your command class:

Now you can do something like this:


All versions of yii-tactician with dependencies

PHP Build Version
Package Version
Requires league/tactician Version 0.6.*
yiisoft/yii Version >=1.1.15
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 pavelmics/yii-tactician contains the following files

Loading the files please wait ....