hautelook/rabbitmq-api

PHP library to interact with the RabbitMQ API

This package's canonical repository appears to be gone and the package has been frozen as a result.

0.1 2014-11-21 05:54 UTC

This package is not auto-updated.

Last update: 2022-01-17 14:02:09 UTC


README

This library exposes the RabbitMQ Management API to PHP through Guzzle.

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

1. Installation

  1. Require the package via composer
$ composer require "hautelook/rabbitmq-api"
  1. Instantiate the library:
$client = new \Hautelook\RabbitMQ\Client(
    [
        'hostname' => 'localhost', // Default, don't have to pass this in
        'scheme' => 'https', // Default, don't have to pass this in
        'port' => 8080, // Default, don't have to pass this in
        'username' => 'guest', // Default, don't have to pass this in
        'password' => 'guest', // Default, don't have to pass this in
        'ssl' => true // Default, don't have to pass this in
    ]
);

2. Usage

2.1 Getting an overview

$overview = $client->getOverview();
print_r($overview);

2.2 Retrieving a queue

$queue = $client->getQueue('/', 'my_queue_name');
print_r($queue);

3. Running tests

You can run the unit and functional tests for this library by running phpunit after installing the dependencies.