Download the PHP package architectnate/triggr-php without Composer

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

TriggrPHP

A lightweight PHP event handling system.

[Packagist]() Build Status Dependency Status codecov.io [Packagist]()

This system allows you to set events and event handlers, fire the events and control the event flow. This is a great way to enabled developers to add event hooks to software.

Note: This is not a replacement for major frameworks like ReactPHP, but more of a supplement tool for other frameworks and situations where event handling would be convenient.

Installation

The recommended way to install Triggr is through composer(https://getcomposer.org/). Type the following command in your shell environment:

php ~/composer.phar require architectnate/triggr-php

Usage

Event Phrase

Using TriggrPHP requires the creation of event phrases. Essentially, an event phrase is an event name with or without a handler name in this format: EventName:HandlerName (or just EventName alone).

These event phrases are used create events. In the case where no handler name is given, one is automatically created. the developer has the option to include a handler name to make what they are doing more clear if they would like.

Firing Events

When bulding out an application you would use the "fire" method to specify where you want actions to occur, such as a pre, or post save method on an Entity. The event phrase contains only the event name, all handlers on that event are fired.

If you need to provide data to the event to be used by it's handlers, you may pass an array of arguments.

In the case that it is needed to fire a specific handler on an event, the fireHandler method may be used. The event phrase this time must have both event name and handler name. Note that arguments are still available to be passed in.

Watching Events

Once events are firing within your application you can "watch" them and perform actions when they fire. To do this, you will call the "watch" method. Every "watch" creates a handler. If you provide an event name or the full event phrase determines if TriggrPHP assigns a handler name for you, or not. It is not necessary to assign each handler it's own name, but it can be useful for more complex uses.

To simply watch an event, provide a name and an action. The action can be any callable, so class methods and procedural methods are all usable.

Watch actions may return data, the "fire" method will pass the data along. Since there may be multiple handlers per event, the returned data is provided in an array, sorted by the order that the handlers were run. Note: "fireHandler" returns mixed data, whatever the "watch" action returns, it returns since there is no potential for multiple handlers.

Options

When watching an event, options can be provided to the handler for a couple of reasons, to limit the number of times it can be run and to set a sort order or priority Defaults: RunLimit = 0, Priority = 100 (A run limit of 0 is infinite).


All versions of triggr-php with dependencies

PHP Build Version
Package Version
Requires php Version >=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 architectnate/triggr-php contains the following files

Loading the files please wait ....