Skip to content

Commit

Permalink
added composer support and autoloading
Browse files Browse the repository at this point in the history
  • Loading branch information
zircote committed May 10, 2012
1 parent 3d2678a commit 790f7c5
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 53 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
lib/php-amqplib vendor
composer.lock
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -6,7 +6,9 @@ Inside the _examples_ folder you can see how to implement RPC, parallel processi


INSTALLATION INSTALLATION


Clone this project and then just run `make` to fetch the dependencies. @see http://getcomposer.org for composer details.

Clone this project and then just run `composer update` to fetch the dependencies.


This project requires the php-amqplib library. This project requires the php-amqplib library.


Expand Down
20 changes: 20 additions & 0 deletions composer.json
@@ -0,0 +1,20 @@
{
"name": "videlalvaro/Thumper",
"type": "library",
"description": "AMQP Tools",
"keywords": ["library", "AMQP", "RabbitMQ", "PHPAMQPLib", "Thumper"],
"homepage": "git://github.com/videlalvaro/Thumper.git",
"autoload": {
"psr-0": {"Thumper": "lib"}
},
"repositories": [
{
"type": "vcs",
"url": "git://github.com/videlalvaro/php-amqplib.git"
}
],
"require": {
"php": ">=5.3.3",
"videlalvaro/php-amqplib" : "master-dev"
}
}
12 changes: 0 additions & 12 deletions config/autoload.php

This file was deleted.

2 changes: 1 addition & 1 deletion config/config.php
@@ -1,5 +1,5 @@
<?php <?php

require_once dirname(__DIR__) . '/vendor/autoload.php';
define('HOST', 'localhost'); define('HOST', 'localhost');
define('PORT', 5672); define('PORT', 5672);
define('USER', 'guest'); define('USER', 'guest');
Expand Down
4 changes: 1 addition & 3 deletions examples/parallel_processing/char_count_server.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/RpcServer.php');


$charCount = function($word) $charCount = function($word)
{ {
Expand Down
4 changes: 1 addition & 3 deletions examples/parallel_processing/parallel_rpc.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/RpcClient.php');


$start = time(); $start = time();


Expand Down
4 changes: 1 addition & 3 deletions examples/parallel_processing/random_int_server.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/RpcServer.php');


$randomInt = function($data) $randomInt = function($data)
{ {
Expand Down
4 changes: 1 addition & 3 deletions examples/queue_server/consumer.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/Consumer.php');


$myConsumer = function($msg) $myConsumer = function($msg)
{ {
Expand Down
4 changes: 1 addition & 3 deletions examples/queue_server/producer.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/Producer.php');


$producer = new Producer(HOST, PORT, USER, PASS, VHOST); $producer = new Producer(HOST, PORT, USER, PASS, VHOST);
$producer->setExchangeOptions(array('name' => 'hello-exchange', 'type' => 'direct')); $producer->setExchangeOptions(array('name' => 'hello-exchange', 'type' => 'direct'));
Expand Down
4 changes: 1 addition & 3 deletions examples/rpc/rpc_client.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/RpcClient.php');


$client = new RpcClient(HOST, PORT, USER, PASS, VHOST); $client = new RpcClient(HOST, PORT, USER, PASS, VHOST);
$client->initClient(); $client->initClient();
Expand Down
4 changes: 1 addition & 3 deletions examples/topic/anon_consumer.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/AnonConsumer.php');


$myConsumer = function($msg) $myConsumer = function($msg)
{ {
Expand Down
4 changes: 1 addition & 3 deletions examples/topic/topic_consumer.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/Consumer.php');


$myConsumer = function($msg) $myConsumer = function($msg)
{ {
Expand Down
4 changes: 1 addition & 3 deletions examples/topic/topic_producer.php
@@ -1,8 +1,6 @@
<?php <?php


require_once(__DIR__ . '/../../config/autoload.php'); require_once(dirname(dirname(__DIR__)) . '/config/config.php');
require_once(__DIR__ . '/../../config/config.php');
require_once(__DIR__ . '/../../lib/Thumper/Producer.php');


$producer = new Producer(HOST, PORT, USER, PASS, VHOST); $producer = new Producer(HOST, PORT, USER, PASS, VHOST);
$producer->setExchangeOptions(array('name' => 'logs-exchange', 'type' => 'topic')); $producer->setExchangeOptions(array('name' => 'logs-exchange', 'type' => 'topic'));
Expand Down
1 change: 0 additions & 1 deletion vendor/symfony/Symfony/Component/ClassLoader
Submodule ClassLoader deleted from 0e6ee8
1 change: 0 additions & 1 deletion vendor/videlalvaro/php-amqplib
Submodule php-amqplib deleted from b74879

0 comments on commit 790f7c5

Please sign in to comment.