Skip to content

Commit fa1f597

Browse files
committed
Merge branch 'master' into ikulis_php
2 parents 36afdae + aa8e81c commit fa1f597

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+842
-272
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ java/rabbitmq-java-client-bin*
1111
javascript-nodejs/node_modules
1212
php/lib/
1313
python-puka/venv
14-
ruby/gems/
14+
ruby*/gems/
15+
venv/*
16+
ruby*/rubygems*

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: ruby
2+
rvm: "1.9.3"
3+
before_install: ./bin/travisci/before_install.sh
4+
script: make test-travisci
5+
services:
6+
- rabbitmq
7+
notifications:
8+
email: michael@rabbitmq.com
9+
branches:
10+
only:
11+
- master
12+
env:
13+
- RUBY=ruby GEM=gem SLOWNESS=4

Makefile

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ all:
1616
# least (as tested on debian 5.0):
1717
#
1818
# apt-get install python-virtualenv git-core php5-cli \
19-
# ruby1.8 ruby1.8-dev rdoc1.8 unzip mono-gmcs sun-java5-jdk \
19+
# ruby1.9 ruby1.9-dev rdoc1.9 unzip mono-gmcs sun-java5-jdk \
2020
# cpan perl
2121
#
2222
#
@@ -31,16 +31,26 @@ all:
3131
# make
3232
# make install
3333
#
34-
test: dotnet/.ok erlang/.ok java/.ok python/.ok php/.ok ruby/.ok python-puka/.ok perl/.ok
35-
RUBYVER=$(RUBYVER) python test.py
34+
setup: dotnet/.ok erlang/.ok java/.ok python/.ok php/.ok ruby-amqp/.ok ruby/.ok python-puka/.ok perl/.ok
3635

37-
RABBITVER:=$(shell curl -s "http://www.rabbitmq.com/releases/rabbitmq-server/?C=N;O=D;F=0;V=1" | grep -oE '([0-9\.]{5,})' | head -n 1)
36+
setup-travisci: dotnet/.ok erlang/.ok java/.ok python/.ok ruby/.ok php/.ok
37+
38+
test: setup
39+
RUBY=$(RUBY) python test.py
40+
41+
test-travisci: setup-travisci
42+
SLOWNESS=4 RUBY=ruby python travisci.py
43+
44+
RABBITVER:=$(shell curl -s "http://www.rabbitmq.com/releases/rabbitmq-server/" | grep -oE '([0-9\.]{5,})' | tail -n 1)
3845
R=http://www.rabbitmq.com/releases
3946

47+
# Default value assumes CI environment
48+
RUBY?=ruby1.9.1
49+
4050
DVER=$(RABBITVER)
4151
dotnet/.ok:
4252
(cd dotnet && \
43-
mkdir lib && \
53+
mkdir -p lib && \
4454
cd lib && \
4555
wget -qc $(R)/rabbitmq-dotnet-client/v$(DVER)/rabbitmq-dotnet-client-$(DVER)-dotnet-3.0.zip && \
4656
unzip -q rabbitmq-dotnet-client-$(DVER)-dotnet-3.0.zip && \
@@ -92,30 +102,32 @@ clean::
92102

93103
php/.ok:
94104
(cd php && \
95-
git clone http://github.com/tnc/php-amqplib.git lib/php-amqplib && \
105+
mkdir -p ./bin && \
106+
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin && \
107+
php ./bin/composer.phar install && \
96108
touch .ok)
97109
clean::
98110
(cd php && \
99111
rm -rf .ok lib)
100112

101-
RUBYVER:=1.8
102-
GEMSVER=1.8.5
113+
GEM?=gem1.9.1
103114
TOPDIR:=$(PWD)
104-
RVER="0.8.0"
105115
ruby/.ok:
106116
(cd ruby && \
107-
wget -qc http://production.cf.rubygems.org/rubygems/rubygems-$(GEMSVER).tgz && \
108-
tar xzf rubygems-$(GEMSVER).tgz && \
109-
cd rubygems-$(GEMSVER) && \
110-
ruby$(RUBYVER) setup.rb --prefix=$(TOPDIR)/ruby/gems && \
111-
cd .. && \
112-
rm -r rubygems-$(GEMSVER).tgz rubygems-$(GEMSVER) && \
113-
GEM_HOME=gems/gems RUBYLIB=gems/lib gems/bin/gem$(RUBYVER) install amqp --version $(RVER) && \
117+
GEM_HOME=gems/gems RUBYLIB=gems/lib $(GEM) install bunny --version ">= 0.9.4" --no-ri --no-rdoc && \
114118
touch .ok)
115119
clean::
116120
(cd ruby && \
117121
rm -rf .ok gems)
118122

123+
ruby-amqp/.ok:
124+
(cd ruby-amqp && \
125+
GEM_HOME=gems/gems RUBYLIB=gems/lib $(GEM) install amqp --no-ri --no-rdoc && \
126+
touch .ok)
127+
clean::
128+
(cd ruby-amqp && \
129+
rm -rf .ok gems)
130+
119131
python-puka/.ok:
120132
(cd python-puka && \
121133
virtualenv venv && \
@@ -125,8 +137,8 @@ python-puka/.ok:
125137

126138
perl/.ok:
127139
(cd perl && \
128-
cpan -i Net::RabbitFoot && \
129-
cpan -i UUID::Tiny && \
140+
PERL_MM_USE_DEFAULT=1 cpan -i -f Net::RabbitFoot && \
141+
PERL_MM_USE_DEFAULT=1 cpan -i -f UUID::Tiny && \
130142
touch .ok)
131143

132144
clean::

bin/travisci/before_install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
sudo apt-get update
4+
5+
sudo apt-get install -y mercurial make xsltproc zip unzip ant ed curl
6+
7+
# Mono
8+
sudo apt-get install -y mono-gmcs mono-xbuild mono-devel mono-runtime
9+
10+
# Python
11+
sudo apt-get install -y python-virtualenv
12+
13+
# PHP
14+
sudo apt-get install -y php5-cli

php/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/*
2+
vendor/*
3+
composer.lock
4+

php/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ Additionally you need `PHP 5.3` and `php-amqplib`. To get these
1212
dependencies on Ubuntu type:
1313

1414
sudo apt-get install git-core php5-cli
15-
git clone http://github.com/videlalvaro/php-amqplib.git lib/php-amqplib
1615

17-
Since the tutorials are tested with `php-amqplib` v1.0 you might want to checkout the `v1.0` tag as well:
16+
Then you can install `php-amqplib` using [Composer](http://getcomposer.org).
1817

19-
cd lib/php-amqplib/
20-
git checkout v1.0
18+
To do that install Composer and add it to your path, then run the following command
19+
inside this project folder:
20+
21+
composer.phar install
2122

2223
## Code
2324

php/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"videlalvaro/php-amqplib": "v2.1.0"
4+
}
5+
}

php/emit_log.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
require_once(__DIR__ . '/lib/php-amqplib/amqp.inc');
3+
require_once __DIR__ . '/vendor/autoload.php';
4+
use PhpAmqpLib\Connection\AMQPConnection;
5+
use PhpAmqpLib\Message\AMQPMessage;
46

57
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
68
$channel = $connection->channel();

php/new_task.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
require_once(__DIR__ . '/lib/php-amqplib/amqp.inc');
3+
require_once __DIR__ . '/vendor/autoload.php';
4+
use PhpAmqpLib\Connection\AMQPConnection;
5+
use PhpAmqpLib\Message\AMQPMessage;
46

57
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
68
$channel = $connection->channel();

php/receive.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

3-
require_once(__DIR__ . '/lib/php-amqplib/amqp.inc');
3+
require_once __DIR__ . '/vendor/autoload.php';
4+
use PhpAmqpLib\Connection\AMQPConnection;
45

56
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
67
$channel = $connection->channel();

0 commit comments

Comments
 (0)