Download the PHP package componenta/event without Composer

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

Componenta Event

PHP 8.4+ License MIT PSR-14 Tests

Minimal PSR-14 event dispatcher with prioritized and composite listener providers. Mutable providers with unsubscribe tokens, immutable dispatcher.

Русская документация

Installation

Requirements

Related Packages

Package Why it matters here
psr/event-dispatcher Defines the PSR-14 dispatcher and listener-provider interfaces.
componenta/auth Can publish authentication and session lifecycle events.
componenta/cqrs Can publish command lifecycle events through EventMiddleware.
componenta/error-handler Can report errors through listeners.
componenta/di Can create listeners from the application container.

Quick Start

Components

EventDispatcher

Final, readonly PSR-14 dispatcher. The provider reference is shared — listeners registered later are visible to all dispatches.

Events implementing Psr\EventDispatcher\StoppableEventInterface halt propagation when isPropagationStopped() becomes true. An already-stopped event skips all listeners.

ListenerProvider

Plain listener registry keyed by event class. addListener() returns an unsubscribe closure.

PrioritizedProvider

Listeners are dispatched in priority order. Sorting is lazy and cache-aware — adding a listener after a dispatch invalidates the cached order.

Priorities are resolved in this order: explicit $priority argument → PrioritizedListenerInterface::$priority → 0. Listeners with equal priority are dispatched in registration order (stable sort).

PrioritizedListenerInterface

Invokable listeners can expose their own priority:

CompositeProvider

Aggregates multiple providers into one. contains() is recursive; has() works across EventTypeAwareProviderInterface children.

Bulk Registration

Patterns

One-shot listener

Scoped subscription

Reference

Symbol Purpose
EventDispatcher PSR-14 dispatcher, final readonly
ListenerProvider Plain keyed-by-event-class registry
PrioritizedProvider Priority-ordered registry with lazy sort
CompositeProvider Aggregate of child providers, recursive contains
EventTypeAwareProviderInterface Contract for providers that expose has(eventType)
PrioritizedListenerInterface Listener-side priority declaration
SortMode ASC / DESC for PrioritizedProvider

All mutable providers expose: addListener, addListeners, removeListener, contains, has. addListener returns an unsubscribe Closure.

License

MIT


All versions of event with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/event-dispatcher Version ^1.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 componenta/event contains the following files

Loading the files please wait ...