Download the PHP package phpway/pubsubwp without Composer

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

Pubsub with priority

Build Status

I hear you - why another pubsub library when there is already a plethora of them? I was looking for a simple PHP publish-subscribe implementation with following properties:

This simple pubsub library tries to fill in this gap.

Example of usage

Create pubsub instance:

Subscribe few callbacks to some topic:

You can also subscribe callback with priority. When topic is published, callbacks are sorted by this priority before they are called (higher priority callbacks will be executed first). Default priority is 0.

When topic is published via PubSub::publish() method, the pubsub will create an event object (inherited from ArrayObject) and it will start passing it through all subscribed callbacks sorted by priorities:

Event's initial data can be specified in the second optional parameter. Each subscribed callback will receive this event object in the (only) parameter.

Callback writing 'A' on tape was executed first since it has higher priority than others.

Callback can also decide to skip all other callbacks in the queue that have not been executed yet. This is done simply via calling Event::stop() method:

This will cause skipping all callbacks with priority lower than 5:

You can also specify your own event that will be passed through the subscribed callbacks. The only requirement is that it must inherit from PubSubWP\Event which is the class of the default event:


All versions of pubsubwp with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.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 phpway/pubsubwp contains the following files

Loading the files please wait ....