From 52a7c23bb19fdc6784c16a46209721c3317219d5 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 17 Nov 2012 21:12:46 -0500 Subject: [PATCH] Working on administration-related php exercise which apparently does not work *at all* when the user/pass combo is wrong or has characters that explode or whatever. --- sylvilagus/php/.gitignore | 1 + sylvilagus/php/rabbitmqctl-examples.php | 32 +++++++++++++++++++++++++ sylvilagus/php/setup | 19 +++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 sylvilagus/php/.gitignore create mode 100644 sylvilagus/php/rabbitmqctl-examples.php create mode 100755 sylvilagus/php/setup diff --git a/sylvilagus/php/.gitignore b/sylvilagus/php/.gitignore new file mode 100644 index 0000000..8d49294 --- /dev/null +++ b/sylvilagus/php/.gitignore @@ -0,0 +1 @@ +/php-amqplib/ diff --git a/sylvilagus/php/rabbitmqctl-examples.php b/sylvilagus/php/rabbitmqctl-examples.php new file mode 100644 index 0000000..5843d47 --- /dev/null +++ b/sylvilagus/php/rabbitmqctl-examples.php @@ -0,0 +1,32 @@ +channel(); + +$channel->exchange_declare('logs-exchange', 'topic', false, true, false); + +$channel->queue_declare('msg-inbox-errors', false, true, false, false); + +$channel->queue_declare('msg-inbox-logs', false, true, false, false); + +$channel->queue_declare('all-logs', false, true, false, false); + +$channel->queue_bind('msg-inbox-errors', 'logs-exchange', 'error.msg-inbox'); + +$channel->queue_bind('msg-inbox-logs', 'logs-exchange', '*.msg-inbox'); + +?> diff --git a/sylvilagus/php/setup b/sylvilagus/php/setup new file mode 100755 index 0000000..9d81869 --- /dev/null +++ b/sylvilagus/php/setup @@ -0,0 +1,19 @@ +#!/bin/bash + +set -x + +if [ ! -d php-amqplib/.git ] ; then + git clone git://github.com/videlalvaro/php-amqplib.git +else + pushd php-amqplib + git fetch + get reset --hard origin/master + popd +fi + +pushd php-amqplib +if [ ! -f composer.phar ] ; then + curl -s https://getcomposer.org/installer | php +fi +php composer.phar install +popd