Download the PHP package superbalist/php-event-pubsub without Composer

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

php-event-pubsub

An event protocol and implementation over pub/sub

Author Build Status StyleCI Packagist Version Total Downloads

This library builds on top of the php-pubsub package and adds support for listening to and dispatching events over pub/sub channels.

Installation

Integrations

Want to get started quickly? Check out some of these integrations:

Usage

Simple Events

A SimpleEvent is an event which takes a name and optional attributes.

Topic Events

A TopicEvent is an event which takes a topic, name, version and optional attributes.

Schema Events

A SchemaEvent is an extension of the TopicEvent and takes a schema and optional attributes. The topic, name and version are derived from the schema.

The schema must be in the format (protocol)://(......)?/events/(topic)/(channel)/(version).json

Custom Events

You can easily use a custom event structure by writing a class which implements the EventInterface interface. You will then need to write a custom translator to translate incoming messages to your own event object.

Your event must implement the following methods.

Translators

A translator is used to translate an incoming message into an event.

The package comes bundled with a SimpleEventMessageTranslator, TopicEventMessageTranslator and a SchemaEventMessageTranslator.

Custom Translators

You can easily write your own translator by implementing the MessageTranslatorInterface interface.

Your translator must implement the following methods.

Validators

A validator is an optional component used to validate an event upon dispatch.

JSONSchemaEventValidator

This package comes bundled with a JSONSchemaEventValidator which works with SchemaEvent type events.

This validator validates events against a JSON Schema Spec using the JSON Guard PHP package.

Please see the "Schema Events" section above and the JSON Guard documentation for usage examples.

Custom Validators

You can write your own validator by implementing the EventValidatorInterface interface.

Your validator must implement the following methods.

Attribute Injectors

An attribute injector allows you to have attributes automatically injected into events when events are dispatched.

The library comes bundled with a few injectors out of the box.

You can write your own injector by implementing the AttributeInjectorInterface or by passing a callable (which returns an array with a 'key' and 'value') to the event manager.

Your injector must implement the following methods.

Here's a usage example demonstrating both a class and a callable.

Custom Class

Callable

Error Handling

The library supports error handlers for when event translation fails, listen expression fails and validation fails.

You can pass callables into the EventManager constructor, or set them as follows:

Examples

The library comes with Dockerfile for running the example scripts.

Run make up.

You will start at a bash prompt in the /opt/php-event-pubsub directory.

To run the examples:


All versions of php-event-pubsub with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
superbalist/php-pubsub Version ^2.0
composer/semver Version ^1.4
league/json-guard Version ^0.5.1
ramsey/uuid Version ^3.5
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 superbalist/php-event-pubsub contains the following files

Loading the files please wait ....