Skip to content

Commit a8129bb

Browse files
committed
Merge branch 'master' into 0.8
2 parents e570724 + 1762822 commit a8129bb

23 files changed

+830
-138
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Change Log
22

3+
## [0.7.15](https://github.com/php-enqueue/enqueue-dev/tree/0.7.15) (2017-09-25)
4+
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.7.14...0.7.15)
5+
6+
- \[FS\]\[RFC\] Change to FIFO queue [\#171](https://github.com/php-enqueue/enqueue-dev/issues/171)
7+
- Transports must support configuration via DSN string [\#87](https://github.com/php-enqueue/enqueue-dev/issues/87)
8+
- Add support of async message processing to transport interfaces. Like Java JMS. [\#27](https://github.com/php-enqueue/enqueue-dev/issues/27)
9+
- \[redis\] add dsn support for redis transport. [\#204](https://github.com/php-enqueue/enqueue-dev/pull/204) ([makasim](https://github.com/makasim))
10+
- \[dbal\]\[bc break\] Performance improvements and new features. [\#199](https://github.com/php-enqueue/enqueue-dev/pull/199) ([makasim](https://github.com/makasim))
11+
12+
- \[FS\] Cannot decode json message [\#202](https://github.com/php-enqueue/enqueue-dev/issues/202)
13+
- \[fs\] fix bugs introduced in \#181. [\#203](https://github.com/php-enqueue/enqueue-dev/pull/203) ([makasim](https://github.com/makasim))
14+
15+
- \[FS\] Cannot decode json message [\#201](https://github.com/php-enqueue/enqueue-dev/issues/201)
16+
- \[FS\] Cannot decode json message [\#200](https://github.com/php-enqueue/enqueue-dev/issues/200)
17+
18+
## [0.7.14](https://github.com/php-enqueue/enqueue-dev/tree/0.7.14) (2017-09-13)
19+
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.7.13...0.7.14)
20+
321
## [0.7.13](https://github.com/php-enqueue/enqueue-dev/tree/0.7.13) (2017-09-13)
422
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.7.12...0.7.13)
523

docs/transport/redis.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,26 @@ $ composer require enqueue/redis predis/predis:^1
3838
<?php
3939
use Enqueue\Redis\RedisConnectionFactory;
4040

41-
$connectionFactory = new RedisConnectionFactory([
42-
'host' => 'localhost',
43-
'port' => 6379,
41+
// connects to localhost
42+
$factory = new RedisConnectionFactory();
43+
44+
// same as above
45+
$factory = new RedisConnectionFactory('redis:');
46+
47+
// same as above
48+
$factory = new RedisConnectionFactory([]);
49+
50+
// connect to Redis at example.com port 1000 using phpredis extension
51+
$factory = new RedisConnectionFactory([
52+
'host' => 'example.com',
53+
'port' => 1000,
4454
'vendor' => 'phpredis',
4555
]);
4656

47-
$psrContext = $connectionFactory->createContext();
57+
// same as above but given as DSN string
58+
$factory = new RedisConnectionFactory('redis://example.com:1000?vendor=phpredis');
59+
60+
$psrContext = $factory->createContext();
4861
```
4962

5063
* With predis library:

docs/transport/sqs.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ $ composer require enqueue/sqs
2222
```php
2323
<?php
2424
use Enqueue\Sqs\SqsConnectionFactory;
25-
26-
$connectionFactory = new SqsConnectionFactory([
25+
26+
$factory = new SqsConnectionFactory([
2727
'key' => 'aKey',
2828
'secret' => 'aSecret',
2929
'region' => 'aRegion',
3030
]);
3131

32-
$psrContext = $connectionFactory->createContext();
32+
// same as above but given as DSN string
33+
$factory = new SqsConnectionFactory('sqs:?key=aKey&secret=aSecret&region=aRegion');
34+
35+
$psrContext = $factory->createContext();
3336
```
3437

3538
## Declare queue.

docs/transport/stomp.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,26 @@ $ composer require enqueue/stomp
1818
<?php
1919
use Enqueue\Stomp\StompConnectionFactory;
2020

21-
$connectionFactory = new StompConnectionFactory([
22-
'host' => '127.0.0.1',
23-
'port' => 61613,
24-
'login' => 'guest',
25-
'password' => 'guest',
26-
'vhost' => '/',
21+
// connects to localhost
22+
$factory = new StompConnectionFactory();
23+
24+
// same as above
25+
$factory = new StompConnectionFactory('stomp:');
26+
27+
// same as above
28+
$factory = new StompConnectionFactory([]);
29+
30+
// connect to stomp broker at example.com port 1000 using
31+
$factory = new StompConnectionFactory([
32+
'host' => 'example.com',
33+
'port' => 1000,
34+
'login' => 'theLogin',
2735
]);
2836

29-
$psrContext = $connectionFactory->createContext();
37+
// same as above but given as DSN string
38+
$factory = new StompConnectionFactory('stomp://example.com:1000?login=theLogin');
39+
40+
$psrContext = $factory->createContext();
3041
```
3142

3243
## Send message to topic

pkg/amqp-bunny/AmqpConnectionFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
4545
*/
4646
public function __construct($config = 'amqp://')
4747
{
48-
if (is_string($config) && 0 === strpos($config, 'amqp+bunny://')) {
49-
$config = str_replace('amqp+bunny://', 'amqp://', $config);
48+
if (is_string($config) && 0 === strpos($config, 'amqp+bunny:')) {
49+
$config = str_replace('amqp+bunny:', 'amqp:', $config);
5050
}
5151

52-
if (empty($config) || 'amqp://' === $config) {
52+
// third argument is deprecated will be removed in 0.8
53+
if (empty($config) || 'amqp:' === $config || 'amqp://' === $config) {
5354
$config = [];
5455
} elseif (is_string($config)) {
5556
$config = $this->parseDsn($config);

pkg/amqp-bunny/Tests/AmqpConnectionFactoryConfigTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ public static function provideConfigs()
7979

8080
// some examples from Appendix A: Examples (https://www.rabbitmq.com/uri-spec.html)
8181

82+
yield [
83+
'amqp+bunny:',
84+
[
85+
'host' => 'localhost',
86+
'port' => 5672,
87+
'vhost' => '/',
88+
'user' => 'guest',
89+
'pass' => 'guest',
90+
'receive_method' => 'basic_get',
91+
'heartbeat' => 0,
92+
'qos_prefetch_size' => 0,
93+
'qos_prefetch_count' => 1,
94+
'qos_global' => false,
95+
'lazy' => true,
96+
],
97+
];
98+
8299
yield [
83100
'amqp+bunny://user:pass@host:10000/vhost',
84101
[

pkg/amqp-ext/AmqpConnectionFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
4747
*/
4848
public function __construct($config = 'amqp://')
4949
{
50-
if (is_string($config) && 0 === strpos($config, 'amqp+ext://')) {
51-
$config = str_replace('amqp+ext://', 'amqp://', $config);
50+
if (is_string($config) && 0 === strpos($config, 'amqp+ext:')) {
51+
$config = str_replace('amqp+ext:', 'amqp:', $config);
5252
}
5353

54-
if (empty($config) || 'amqp://' === $config) {
54+
// third argument is deprecated will be removed in 0.8
55+
if (empty($config) || 'amqp:' === $config || 'amqp://' === $config) {
5556
$config = [];
5657
} elseif (is_string($config)) {
5758
$config = $this->parseDsn($config);

pkg/amqp-ext/Tests/AmqpConnectionFactoryConfigTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@ public static function provideConfigs()
8181

8282
// some examples from Appendix A: Examples (https://www.rabbitmq.com/uri-spec.html)
8383

84+
yield [
85+
'amqp+ext:',
86+
[
87+
'host' => 'localhost',
88+
'port' => 5672,
89+
'vhost' => '/',
90+
'user' => 'guest',
91+
'pass' => 'guest',
92+
'read_timeout' => null,
93+
'write_timeout' => null,
94+
'connect_timeout' => null,
95+
'persisted' => false,
96+
'lazy' => true,
97+
'pre_fetch_count' => null,
98+
'pre_fetch_size' => null,
99+
'receive_method' => 'basic_get',
100+
],
101+
];
102+
84103
yield [
85104
'amqp+ext://user:pass@host:10000/vhost',
86105
[

pkg/amqp-lib/AmqpConnectionFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
5050
*/
5151
public function __construct($config = 'amqp://')
5252
{
53-
if (is_string($config) && 0 === strpos($config, 'amqp+lib://')) {
54-
$config = str_replace('amqp+lib://', 'amqp://', $config);
53+
if (is_string($config) && 0 === strpos($config, 'amqp+lib:')) {
54+
$config = str_replace('amqp+lib:', 'amqp:', $config);
5555
}
5656

57-
if (empty($config) || 'amqp://' === $config) {
57+
// third argument is deprecated will be removed in 0.8
58+
if (empty($config) || 'amqp:' === $config || 'amqp://' === $config) {
5859
$config = [];
5960
} elseif (is_string($config)) {
6061
$config = $this->parseDsn($config);

pkg/amqp-lib/Tests/AmqpConnectionFactoryConfigTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,33 @@ public static function provideConfigs()
8989

9090
// some examples from Appendix A: Examples (https://www.rabbitmq.com/uri-spec.html)
9191

92+
yield [
93+
'amqp+lib:',
94+
[
95+
'host' => 'localhost',
96+
'port' => 5672,
97+
'vhost' => '/',
98+
'user' => 'guest',
99+
'pass' => 'guest',
100+
'read_timeout' => 3,
101+
'write_timeout' => 3,
102+
'lazy' => true,
103+
'receive_method' => 'basic_get',
104+
'stream' => true,
105+
'insist' => false,
106+
'login_method' => 'AMQPLAIN',
107+
'login_response' => null,
108+
'locale' => 'en_US',
109+
'keepalive' => false,
110+
'heartbeat' => 0,
111+
'connection_timeout' => 3.0,
112+
'read_write_timeout' => 3.0,
113+
'qos_prefetch_size' => 0,
114+
'qos_prefetch_count' => 1,
115+
'qos_global' => false,
116+
],
117+
];
118+
92119
yield [
93120
'amqp+lib://user:pass@host:10000/vhost',
94121
[

0 commit comments

Comments
 (0)