Skip to content

Commit b4b3830

Browse files
committed
removed author tags
1 parent 4f75c10 commit b4b3830

14 files changed

+60
-56
lines changed

php-amqp/README.md

Whitespace-only changes.

php-amqp/emit_log.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
emit_log.php
5-
@author Chimdi Azubuike <[email protected]>
6-
*/
72

83
//Establish connection to AMQP
94
$connection = new AMQPConnection();

php-amqp/emit_log_direct.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
emit_log_direct.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
72

83
//Establish connection to AMQP
94
$connection = new AMQPConnection();

php-amqp/emit_log_topic.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
emit_log_topic.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
72

83
//Establish connection to AMQP
94
$connection = new AMQPConnection();

php-amqp/new_task.php

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
@author Chimdi Azubuike <[email protected]>
5-
*/
62

73
//Establish connection to AMQP
84
$connection = new AMQPConnection();

php-amqp/receive.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
@author Chimdi Azubuike <[email protected]>
5-
*/
2+
63

74
//Establish connection AMQP
85
$connection = new AMQPConnection();

php-amqp/receive_log_topic.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
receive_log_topic.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
72

83
//Establish connection to AMQP
94
$connection = new AMQPConnection();

php-amqp/receive_logs.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
receive_logs.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
2+
73

84
//Establish connection to AMQP
95
$connection = new AMQPConnection();

php-amqp/receive_logs_direct.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
receive_logs_direct.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
72

83
//Establish Connection
94
$connection = new AMQPConnection();

php-amqp/receive_logs_topic.php

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
4+
//Establish Connection
5+
$connection = new AMQPConnection();
6+
$connection->setHost('127.0.0.1');
7+
$connection->setLogin('guest');
8+
$connection->setPassword('guest');
9+
$connection->connect();
10+
11+
12+
//Listen on Channel
13+
$channel = new AMQPChannel($connection);
14+
15+
16+
$binding_keys = array_slice($argv,1);
17+
if(empty($binding_keys)) {
18+
file_put_contents('php://stderr', "Usage: {$argv[0]} [binding_key]...\n");
19+
exit(1);
20+
}
21+
22+
echo " [*] Waiting for logs. To exit press CTRL+C", PHP_EOL;
23+
$callback_func = function(AMQPEnvelope $message, AMQPQueue $q) {
24+
echo sprintf(" [X] [%s] %s",$message->getRoutingKey(),$message->getBody()), PHP_EOL;
25+
$q->nack($message->getDeliveryTag());
26+
return true;
27+
};
28+
29+
30+
31+
try {
32+
//Declare Exchange
33+
$exchange_name = 'topic_logs';
34+
$exchange = new AMQPExchange($channel);
35+
$exchange->setType(AMQP_EX_TYPE_TOPIC);
36+
$exchange->setName($exchange_name);
37+
$exchange->declareExchange();
38+
39+
40+
41+
//Declare Queue
42+
$queue = new AMQPQueue($channel);
43+
$queue->setFlags(AMQP_EXCLUSIVE);
44+
$queue->declareQueue();
45+
foreach($binding_keys as $binding_key) {
46+
$queue->bind($exchange_name, $binding_key);
47+
}
48+
49+
$queue->consume($callback_func);
50+
} catch(AMQPQueueException $ex) {
51+
print_r($ex);
52+
} catch(Exception $ex) {
53+
print_r($ex);
54+
}

php-amqp/rpc_client.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
rpc_client.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
2+
73

84
class FibonacciRpcClient {
95
private $connection;

php-amqp/rpc_server.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
rpc_server.php
5-
@author: Chimdi Azubuike <[email protected]>
6-
*/
2+
73

84
function fib($n) {
95
if($n == 0)

php-amqp/send.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
@author Chimdi Azubuike <[email protected]>
5-
*/
2+
63

74
//Establish connection to AMQP
85
$connection = new AMQPConnection();

php-amqp/worker.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#!/usr/bin/env php
21
<?php
3-
/**
4-
@author Chimdi Azubuike <[email protected]>
5-
*/
2+
63

74
//Establish connection AMQP
85
$connection = new AMQPConnection();

0 commit comments

Comments
 (0)