Download the PHP package entanet/pub-sub-laravel without Composer

On this page you can find all versions of the php package entanet/pub-sub-laravel. 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 pub-sub-laravel

Pub Sub Laravel

Pub-sub-laravel streamlines using the pub-sub pattern in Laravel. It's based on superbalist/laravel-pubsub.

Publishing to a topic overview

Pub-sub-laravel allows you to publish a message to an external queue via an event without having to add a listener to publish the message. It uses the PubSubEvent via alias/facade or a bit of tinkering with the Laravel global helper.

Subscribing to a topic overview

You can subscribe to a queue using the PubSub2ListenerCommand so that you don't need to create an event to trigger the target listeners.

Prerequisities

Make sure you've included the laravel-pubsub service provider in config/app.php:

Installing and setting up

Run the below in your Laravel project to install the library:

Registering the service providers

To register the PubSubEventProvider and PubSub2ListenerProvider add the below line into the providers array in config/app.php in Laravel:

Add an alias to the PubSubEventFacade

To add an alias to the facade add the following to the alias array in config/app.php in Laravel:

Also you can alter the current event alias so that any current Event calls use the PubSubEvent:

Change:

To:

Overriding the Laravel global helper event

Laravel comes with a global helper event which dispatches the given event so you don't have to use the facade. If you want to override that helper with the PubSubEvent you need to require the PubSubEventHelper.php file before the vendor/autoload.php. Here is an example, altering the public/index.php file in Laravel 5.6:

Set up the listeners for this topic for PubSub2ListenerCommand

For each topic you are consuming add a mapping in Providers/EventServiceProvider.php

Using pub-sub-laravel

Using PubSubEvent via the Alias/facade

Call dispatch from the facade and supply a relevant event containing the event data and topic (new \App\Events\PubEvent($data, 'topic_name'))

Or if you have altered the existing Event alias:

Using PubSubEvent via event global helper

If you overridden the global helper:

Using a PubSub2ListenerCommand to listen to a topic

run the following artisan command appended with the topic name, in this instance the topic is test_topic:

Using PubSubTest

PubSubTest sets a mock of the PubSubInterface for you to use in your unit tests and also includes a handy invokeMethod which can be used to test protected/private functions. So If you had a privateMethod method in a TricksyClass you'd do something like this:

If it took two variables $var1 and $var2:


All versions of pub-sub-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
illuminate/support Version ^5.6
superbalist/laravel-pubsub Version ^3.0
superbalist/php-pubsub-kafka Version ^2.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 entanet/pub-sub-laravel contains the following files

Loading the files please wait ....