Download the PHP package purpleharmonie/event-system without Composer

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

Purpleharmonie Event System

Table of Contents

  1. Introduction
  2. Features
  3. Installation
  4. Basic Usage
  5. Advanced Concepts
    • Event Subscribers
    • Prioritized Listeners
    • Stoppable Events
    • Event Validation
    • Middleware
    • Conditional Event Dispatching
    • Asynchronous Event Handling
  6. Integration with Dependency Injection
  7. Best Practices
  8. API Reference

Introduction

Purpleharmonie Event System is a flexible and powerful event dispatching library for PHP applications. It provides a robust implementation of the PSR-14 Event Dispatcher standard, along with additional features for advanced use cases.

Features

Installation

You can install the Purpleharmonie Event System using Composer:

Basic Usage

Here's a simple example of how to use the event system:

Advanced Concepts

Event Subscribers

Event subscribers allow you to group multiple event listeners in a single class:

Prioritized Listeners

You can set priorities for listeners to control their execution order:

Stoppable Events

Stoppable events allow you to prevent further event propagation:

Event Validation

You can implement the ValidatableEventInterface to add custom validation logic to your events:

Middleware

Middleware allows you to intercept and modify events before they reach the listeners:

Conditional Event Dispatching

The ConditionalEventDispatcher allows you to add conditions for event dispatching:

Asynchronous Event Handling

You can implement the AsyncEventDispatcherInterface to handle events asynchronously:

Integration with Dependency Injection

Here's an example of how to integrate the event system with a dependency injection container:

Best Practices

  1. Keep events small and focused on a single aspect of your application.
  2. Use event subscribers for organizing related listeners.
  3. Utilize priorities to ensure proper execution order of listeners.
  4. Implement validation for critical events to ensure data integrity.
  5. Use middleware for cross-cutting concerns that apply to multiple events.
  6. Consider using asynchronous event handling for time-consuming operations.

API Reference

For a complete API reference, please generate API documentation using a tool like phpDocumentor.


All versions of event-system with dependencies

PHP Build Version
Package Version
Requires psr/event-dispatcher Version ^1.0
psr/log Version ^3.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 purpleharmonie/event-system contains the following files

Loading the files please wait ....