Download the PHP package astrotechlabs/yii2-tactician without Composer

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

Yii2 Tactician Command Bus

Packagist PHP Version Support GitHub stars GitHub forks GitHub repo size GitHub license

This is a Yii Framework 2 Wrapper/Adapter for Tactician Command Bus Library. It provides an easy way to use the command bus pattern in Yii2 Based apps.

When should I use Command Bus?

Tactician is a great fit if you’ve got a service layer. If you’re not sure what a service layer is, Martin Fowler’s PoEAA is a good starting point. Tactician’s author also did a talk on the subject.

Commands really help capture user intent. They’re also a great stand-in for the models when it comes to forms or serializer libraries that expect getter/setter objects.

The command bus itself is really easy to decorate with extra behaviors, like locking or database transactions so it’s very easy to extend with plugins.

By: tactician.thephpleague.com

When should I NOT use it?

If you’ve got a very small app that doesn’t need a service layer, then Tactician won’t offer much to you.

If you’re already using a tool that provides a command bus (like Broadway), you’re probably okay there too.

By: tactician.thephpleague.com

Installation

Setup

First you must have configure your Yii Dependency Injection Container to be able to use Command and Handler classes within it.

You should have something like this in your config/web.php:

IMPORTANT: you must follow the conventions below:

The last one is register Yii2TacticianCommandBus component in your config/web.php file, as below:

How to Use

Mapping Command and Handler Classes

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

Define your Handler class should be something like:

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

Using String Path

You can use a command class as String Path instead of concrete object. For this case, just do:

Your Handle Class should be as follows:

IMPORTANT: in this way your Handler Class MUST implements the AstrotechLabs\Yii2Tactician\Command.

Your controller action or anywhere else:

Under the hood the Command Bus System will call:

where $command argument is created inside that like:

Enjoy =).

Authors

See also the list of contributors who participated in this project.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Licence

This package is released under the MIT License. See the bundled LICENSE for details.

References


All versions of yii2-tactician with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
league/tactician Version ^1.1
yiisoft/yii2 Version ~2.0.41
yidas/yii2-bower-asset Version ~2.0.13
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 astrotechlabs/yii2-tactician contains the following files

Loading the files please wait ....