Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #41 from brikou/dev_composer

fixed composer autoloading usage
  • Loading branch information...
commit a0c3be48f8e824623e142e11eb170c479959f512 2 parents 2eaea42 + 6a708c1
@videlalvaro authored
View
4 .gitignore
@@ -1,3 +1 @@
-.project
-.buildpath
-.settings/
+vendor/
View
3  .gitmodules
@@ -1,3 +0,0 @@
-[submodule "vendor/symfony/Symfony/Component/ClassLoader"]
- path = vendor/symfony/Symfony/Component/ClassLoader
- url = git://github.com/symfony/ClassLoader.git
View
17 Makefile
@@ -1,19 +1,8 @@
-VENDOR = vendor
-COMPONENTS = $(VENDOR)/symfony/Symfony/Component
-CLASS_LOADER = $(COMPONENTS)/ClassLoader/UniversalClassLoader.php
-
-all: $(CLASS_LOADER)
-
-$(CLASS_LOADER):
- git submodule init
- git submodule update
-
-test: all
+test:
phpunit
-
-benchmark: all
+benchmark:
@echo "Publishing 4000 msgs with 1KB of content:"
php benchmark/producer.php 4000
@echo "Consuming 4000:"
- php benchmark/consumer.php
+ php benchmark/consumer.php
View
4 PhpAmqpLib/Tests/bootstrap.php
@@ -1,4 +1,4 @@
<?php
-include_once(__DIR__.'/../../demo/autoload.php');
-include_once(__DIR__.'/config.php');
+require_once __DIR__.'/../../vendor/autoload.php';
+require_once __DIR__.'/config.php';
View
3  PhpAmqpLib/Tests/config.php
@@ -1,7 +1,8 @@
<?php
+
define('HOST', 'localhost');
define('PORT', 5672);
define('USER', 'phpamqplib');
define('PASS', 'phpamqplib_password');
define('VHOST', 'phpamqplib_testbed');
-define('AMQP_DEBUG', false);
+define('AMQP_DEBUG', false);
View
26 README.md
@@ -30,9 +30,10 @@ Get the library source code:
$ git clone git://github.com/videlalvaro/php-amqplib.git
-This library uses the `Symfony` default `UniversalClassLoader` so you will have to run the following command to download it as a submodule:
+Class autoloading and dependencies are managed by `composer` so install it:
- $ make
+ $ curl --silent https://getcomposer.org/installer | php
+ $ php composer.phar install
## Usage ##
@@ -63,25 +64,6 @@ If you need to listen to the sockets used to connect to RabbitMQ then see the ex
- `amqp_consumer_fanout_{1,2}.php` and `amqp_publisher_fanout.php`: demoes fanout exchanges with named queues.
- `basic_get.php`: demoes obtaining messages from the queues by using the _basic get_ AMQP call.
-## Loading Classes ##
-
-The library uses the [Symfony ClassLoader component](https://github.com/symfony/ClassLoader) in order to use a standard way of class loading.
-
-If you want to see how to use the component with this library you can take a look at the file `demo/autoload.php`:
-
- <?php
-
- require_once(__DIR__ . '/../vendor/symfony/Symfony/Component/ClassLoader/UniversalClassLoader.php');
-
- use Symfony\Component\ClassLoader\UniversalClassLoader;
-
- $loader = new UniversalClassLoader();
- $loader->registerNamespaces(array(
- 'PhpAmqpLib' => __DIR__ . '/..',
- ));
-
- $loader->register();
-
## Debugging ##
If you want to know what's going on at a protocol level then add the following constant to your code:
@@ -135,5 +117,3 @@ For bug reports, please use bug tracking system at the project page.
Patches are very welcome!
Author: Vadim Zaliva <lord@crocodile.org>
-
-
View
7 benchmark/config.php
@@ -1,5 +1,6 @@
<?php
-include_once(__DIR__.'/../demo/autoload.php');
+
+require_once __DIR__.'/../vendor/autoload.php';
define('HOST', 'localhost');
define('PORT', 5672);
@@ -7,5 +8,5 @@
define('PASS', 'guest');
define('VHOST', '/');
-//If this is enabled you can see AMQP output on the CLI
-define('AMQP_DEBUG', false);
+// If this is enabled you can see AMQP output on the CLI
+define('AMQP_DEBUG', false);
View
3  bin/ci/before_build.sh
@@ -1,5 +1,8 @@
#!/bin/sh
+curl --silent https://getcomposer.org/installer | php
+php composer.phar install
+
# phpamqplib:phpamqplib_password has full access to phpamqplib_testbed
sudo rabbitmqctl add_vhost phpamqplib_testbed
View
12 demo/autoload.php
@@ -1,12 +0,0 @@
-<?php
-
-require_once(__DIR__ . '/../vendor/symfony/Symfony/Component/ClassLoader/UniversalClassLoader.php');
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array(
- 'PhpAmqpLib' => __DIR__ . '/..',
- ));
-
-$loader->register();
View
5 demo/basic_return.php
@@ -1,9 +1,10 @@
<?php
+
+require_once __DIR__.'/../vendor/autoload.php';
+
use PhpAmqpLib\Message\AMQPMessage;
use PhpAmqpLib\Connection\AMQPConnection;
-require_once('autoload.php');
-
$connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
View
3  demo/config.php
@@ -1,5 +1,6 @@
<?php
-include_once(__DIR__.'/autoload.php');
+
+require_once __DIR__.'/../vendor/autoload.php';
define('HOST', 'localhost');
define('PORT', 5672);
1  vendor/symfony/Symfony/Component/ClassLoader
@@ -1 +0,0 @@
-Subproject commit 5cd07e40f6894c084cfc1eb02fd25d6005e6646c
Please sign in to comment.
Something went wrong with that request. Please try again.