Download the PHP package phpdot/event without Composer

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

phpdot/event

A PSR-14 event dispatcher where the #[Listener] attribute is the registration — no central config, no service providers. Listeners are ordered, can run synchronously or be queued for async dispatch, and the listener set is resolved through a repository so it can be persisted and toggled at runtime.

Table of Contents

Requirements

Requirement Constraint
PHP >= 8.5
phpdot/attribute ^0.4
phpdot/console ^0.4
phpdot/contracts ^0.4
psr/container ^2.0
psr/event-dispatcher ^1.0
symfony/console ^8.0

Installation

Usage

Events and listeners

An event is any class. A handler declares what it handles with #[Listener] — the attribute is the registration:

Discovery and wiring

The attribute is the whole registration — AttributeListenerDiscovery scans with phpdot/attribute and answers the entries boot loads. Nothing else re-states the binding:

Every service carries #[Singleton]/#[Binds] — in a phpdot application the PSR-14 interfaces resolve from the container; event:list prints the discovered surface (event, listener, order, mode) with --event <name> to filter.

Fail-loud at boot: a declared event that is not a class, or a priority outside 0-10, is a ListenerException naming the listener — never a silent listener that never fires.

Dispatching

Dispatch runs two phases: every sync listener first, in order (lowest first), with StoppableEventInterface semantics honored per PSR-14 — then every async listener is handed to the AsyncDispatcherInterface in order. Propagation stop halts everything after it, async listeners included; an async listener ordered before the stopper still publishes. Every dispatch carries a span (event.dispatch on the event channel) with one event.listener event per listener — observability through phpdot/contracts, per the v0.3.0 doctrine.

Async listeners

A listener marked #[Listener(..., async: true)] is handed to the injected AsyncDispatcherInterface instead of running inline. SyncOnlyDispatcher is the shipped fallback: publish means run, immediately, inline after the sync phase — priority is ignored (there is no queue to order) and a handler failure is a ListenerException (it ran — never disguised as a queue failure). Bind a queue backend when timing matters — whichever broker the application installed; the dispatcher publishes, the application's worker consumes.

Architecture

EventDispatcher asks the ListenerProvider for the ordered listeners of an event, resolves each handler class through the container, and either invokes it synchronously or hands it to the async dispatcher. The listener set itself comes from a repository, so it can be discovered from attributes, persisted, and toggled without touching code.

Testing

License

MIT.

This repository is a read-only mirror, generated by CI from phpdot/monorepo. Pull requests and issues belong in the monorepo.


All versions of event with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
phpdot/attribute Version ^0.5
phpdot/console Version ^0.5
phpdot/contracts Version ^0.5
psr/container Version ^2.0
psr/event-dispatcher Version ^1.0
symfony/console Version ^8.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 phpdot/event contains the following files

Loading the files please wait ...