Download the PHP package shlinkio/shlink-event-dispatcher without Composer

On this page you can find all versions of the php package shlinkio/shlink-event-dispatcher. 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 shlink-event-dispatcher

Shlink Event Dispatcher

This library simplifies registering async and regular PSR-14 event listeners while using RoadRunner.

Async ones are executed using RoadRunner jobs. This library takes care of the boilerplate of registering events as async tasks/jobs, and you just interact with plain PSR-14 listeners and events.

Most of the elements it provides require a PSR-11 container, and it's easy to integrate on mezzio applications thanks to the ConfigProvider it includes.

Build Status Code Coverage Latest Stable Version License Paypal donate

Install

Install this library using composer:

composer require shlinkio/shlink-event-dispatcher

This library is also a mezzio module which provides its own ConfigProvider. Add it to your configuration to get everything automatically set up.

Usage

This module allows to register both regular and asynchronous event listeners on a PSR-14 EventDispatcher.

Regular listeners are executed on the same process, blocking the dispatching of the HTTP request, while asynchronous listeners are delegated to a RoadRunner job, making the request to resolve immediately.

If RoadRunner is not found, async listeners are ignored by default, but you can choose to make them to be registered as regular listeners instead.

Note In order to be able to integrate with RoadRunner jobs, you need to install spiral/roadrunner-jobs.

In order to register listeners you have to use a configuration like this:

The events config entry has these blocks.

In both cases, listeners are identified by their service name, making the services to be lazily resolved only when their corresponding event gets dispatched.

Dynamically skip registering listeners

Sometimes you want to provide a base list of listeners for an event, but you may want to skip them from being actually registered based on some logic known only at runtime.

For example, if you have a listener to send events to RabbitMQ, but the feature is optional and a user could have disabled it. In that case you could check at runtime if the feature is disabled, and skip the listener registration.

This module allows a Shlinkio\Shlink\EventDispatcher\Listener\EnabledListenerCheckerInterface service to be registered, and if it resolves an instance opf that same type, it will be used to decide if listeners should be registered or not.

The service registered there has to implement this method:

If the service is not found, or it resolves an instance of the wrong type, a default implementation is used, which registers all listeners.


All versions of shlink-event-dispatcher with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
league/event Version ^3.0
psr/event-dispatcher Version ^1.0
psr/log Version ^3.0
shlinkio/shlink-config Version ^4.0 || ^3.4
shlinkio/shlink-json Version ^1.2
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 shlinkio/shlink-event-dispatcher contains the following files

Loading the files please wait ....