Download the PHP package umer936/cakephp-rabbitmq without Composer

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

Working, but not maintained


I no longer use this plugin in favor of https://github.com/dereuromark/cakephp-queue

Additionally, there is https://github.com/cakephp/queue which features a lot more transports, including AMQP Bunny (core of RabbitMQ): https://php-enqueue.github.io/transport

See also: https://github.com/FriendsOfCake/awesome-cakephp#queue for more options

This plugin will still live on in case someone needs RabbitMQ to just work in CakePHP 4

composer.json:

Application.php (likely don't need the options array but for some reason I added it at some point)

CakePHP RabbitMQ plugin

Build Status StyleCI Status Coverage Status Total Downloads

RabbitMQ plugin for CakePHP 4.

Requirements

Why use this plugin?

Use this plugin to drastically reduce page load times by offloading time consuming processes (like sending emails and resizing uploaded images) to a CLI consumer using messages in RabbitMQ. Could also be used to communicate with other systems or, for example, log lintes.

Installation

Install the plugin using Composer:

Now load the plugin by either running this shell command:

or by manually adding the following line to config/bootstrap.php:

Lastly, add a new Gearman configuration section to (most likely) app.php:

Optional: system verification

Before proceeding, you might want to verify that the Gearman Job Server is actually up and running on your local system.

On Ubuntu systems running sudo netstat -peanut | grep gearman should produce something similar to:

Usage

Using this plugin comes down to:

  1. Configuring your task(s)
  2. Starting the WorkerShell on your local system
  3. Offloading tasks from within your application code by using the execute() function found in the JobAwareTrait

To start the WorkerShell so it will listen for incoming tasks run the following command on your local system:

Built-in Tasks

Email Task

This plugin comes with a built-in email task that allows you to start offloading emails using the worker instantly.

To enable the email task first add the following job to your Gearman configuration section:

Then add the following worker configuration to your existing EmailTransporter configuration section (most likely found in app.php):

Now all you need to do is use this EmailTransporter in your application when sending emails and it will automatically offload all email sending to the built-in task using the EmailTransporter defined in the transport key. E.g.

If things went well you should see the worker providing feedback on tasks being processed shown below:

Creating your own tasks

1. Create the Task

As an example we will create the following SleepTask that:

Please note that the plugin will take care of arrays and objects. When you submit an array in the task, you will receive an array in the workload.

2. Start using the task

To start using the task:

  1. include the JobAwareTrait in your application code
  2. use the $this->execute function to pass the job to Gearman

Please note that the execute() method takes the following parameters:

Patches & Features

Before submitting a PR please make sure that:

Bugs & Feedback

http://github.com/0100Dev/cakephp-rabbtmq/issues


All versions of cakephp-rabbitmq with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
php-amqplib/php-amqplib Version *
cakephp/cakephp Version ^4.0.0
ext-json Version *
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 umer936/cakephp-rabbitmq contains the following files

Loading the files please wait ....