mkhairul/amqp

PhpAmqpLib 封装器

dev-master / 1.0.x-dev 2015-09-15 22:27 UTC

This package is not auto-updated.

Last update: 2024-10-02 10:07:04 UTC


README

这是一个PhpAmqpLib的封装器。

安装

通过 Composer

$ composer require mkhairul/amqp dev-master

使用方法

YAML 配置文件(config.yaml)

rabbit:
  host: localhost
  port: 5672
  login: guest
  pass: guest
  vhost: /
  exchange:
    name: someExchange
  queue:
	name: someQueue

脚本

<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
use Mkhairul\AMQPWrapper\AMQPWrapper;

$config = Yaml::parse(file_get_contents('config.yaml'));
$conn = new AMQPWrapper($config, 'rabbit');
$conn->sendMessage('message-type', 'Time\'s Up!');

许可证

MIT 许可证(MIT)。有关更多信息,请参阅许可证文件