Skip to content

Commit edad64d

Browse files
committed
Merge branch 'master' into 0.9
2 parents 31fc7ff + 11dc9f4 commit edad64d

7 files changed

Lines changed: 71 additions & 3 deletions

File tree

‎CHANGELOG.md‎

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

3+
## [0.8.18](https://github.com/php-enqueue/enqueue-dev/tree/0.8.18) (2018-02-07)
4+
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.8.17...0.8.18)
5+
6+
- \[SQS\] Allow custom aws endpoint configuration [\#352](https://github.com/php-enqueue/enqueue-dev/issues/352)
7+
- Added endpoint configuration and updated the tests [\#353](https://github.com/php-enqueue/enqueue-dev/pull/353) ([gitis](https://github.com/gitis))
8+
9+
- Transport is not enabled: amqp: [\#356](https://github.com/php-enqueue/enqueue-dev/issues/356)
10+
- \[bundle\] DefaultTransportFactory should accept DSN like foo: [\#358](https://github.com/php-enqueue/enqueue-dev/pull/358) ([makasim](https://github.com/makasim))
11+
- \[dbal\] Consumer never fetches messages ordered by published time [\#343](https://github.com/php-enqueue/enqueue-dev/pull/343) ([f7h](https://github.com/f7h))
12+
13+
- \[SQS\] Unable to connect to FIFO queue [\#342](https://github.com/php-enqueue/enqueue-dev/issues/342)
14+
- \[dbal\] Consumer never fetches messages ordered by published time [\#340](https://github.com/php-enqueue/enqueue-dev/issues/340)
15+
16+
- Moved symfony/framework-bundle to require-dev [\#348](https://github.com/php-enqueue/enqueue-dev/pull/348) ([prisis](https://github.com/prisis))
17+
- Gearman PHP 7 support [\#347](https://github.com/php-enqueue/enqueue-dev/pull/347) ([Jawshua](https://github.com/Jawshua))
18+
319
## [0.8.17](https://github.com/php-enqueue/enqueue-dev/tree/0.8.17) (2018-01-18)
420
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.8.16...0.8.17)
521

‎pkg/enqueue/Symfony/DefaultTransportFactory.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function addConfiguration(ArrayNodeDefinition $builder)
5858
}
5959

6060
if (is_string($v)) {
61-
return false !== strpos($v, '://') || false !== strpos($v, 'env_') ?
61+
return false !== strpos($v, ':') || false !== strpos($v, 'env_') ?
6262
['dsn' => $v] :
6363
['alias' => $v];
6464
}

‎pkg/enqueue/Tests/Symfony/DefaultTransportFactoryTest.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ public function testShouldAllowAddConfigurationAsDsn()
7272
$this->assertEquals(['dsn' => 'dsn://'], $config);
7373
}
7474

75+
/**
76+
* @see https://github.com/php-enqueue/enqueue-dev/issues/356
77+
*
78+
* @group bug
79+
*/
80+
public function testShouldAllowAddConfigurationAsDsnWithoutSlashes()
81+
{
82+
$transport = new DefaultTransportFactory();
83+
$tb = new TreeBuilder();
84+
$rootNode = $tb->root('foo');
85+
86+
$transport->addConfiguration($rootNode);
87+
$processor = new Processor();
88+
$config = $processor->process($tb->buildTree(), ['dsn:']);
89+
90+
$this->assertEquals(['dsn' => 'dsn:'], $config);
91+
}
92+
7593
public function testShouldSetNullTransportByDefault()
7694
{
7795
$transport = new DefaultTransportFactory();

‎pkg/job-queue/composer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"license": "MIT",
88
"require": {
99
"php": ">=5.6",
10-
"symfony/framework-bundle": "^2.8|^3|^4",
1110
"enqueue/enqueue": "^0.9@dev",
1211
"enqueue/null": "^0.9@dev",
1312
"doctrine/orm": "~2.4"
@@ -17,7 +16,8 @@
1716
"enqueue/test": "^0.9@dev",
1817
"doctrine/doctrine-bundle": "~1.2",
1918
"symfony/browser-kit": "^2.8|^3|^4",
20-
"symfony/expression-language": "^2.8|^3|^4"
19+
"symfony/expression-language": "^2.8|^3|^4",
20+
"symfony/framework-bundle": "^2.8|^3|^4"
2121
},
2222
"support": {
2323
"email": "opensource@forma-pro.com",

‎pkg/sqs/SqsConnectionFactory.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class SqsConnectionFactory implements PsrConnectionFactory
2626
* 'retries' => 3, - (int, default=int(3)) Configures the maximum number of allowed retries for a client (pass 0 to disable retries).
2727
* 'version' => '2012-11-05', - (string, required) The version of the webservice to utilize
2828
* 'lazy' => true, - Enable lazy connection (boolean)
29+
* 'endpoint' => null - (string, default=null) The full URI of the webservice. This is only required when connecting to a custom endpoint e.g. localstack
2930
* ].
3031
*
3132
* or
@@ -93,6 +94,10 @@ private function establishConnection()
9394
'region' => $this->config['region'],
9495
];
9596

97+
if (isset($this->config['endpoint'])) {
98+
$config['endpoint'] = $this->config['endpoint'];
99+
}
100+
96101
if ($this->config['key'] && $this->config['secret']) {
97102
$config['credentials'] = [
98103
'key' => $this->config['key'],
@@ -151,6 +156,7 @@ private function defaultConfig()
151156
'retries' => 3,
152157
'version' => '2012-11-05',
153158
'lazy' => true,
159+
'endpoint' => null,
154160
];
155161
}
156162
}

‎pkg/sqs/Tests/SqsConnectionFactoryConfigTest.php‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static function provideConfigs()
6262
'retries' => 3,
6363
'version' => '2012-11-05',
6464
'lazy' => true,
65+
'endpoint' => null,
6566
],
6667
];
6768

@@ -75,6 +76,7 @@ public static function provideConfigs()
7576
'retries' => 3,
7677
'version' => '2012-11-05',
7778
'lazy' => true,
79+
'endpoint' => null,
7880
],
7981
];
8082

@@ -88,6 +90,7 @@ public static function provideConfigs()
8890
'retries' => 3,
8991
'version' => '2012-11-05',
9092
'lazy' => true,
93+
'endpoint' => null,
9194
],
9295
];
9396

@@ -101,6 +104,7 @@ public static function provideConfigs()
101104
'retries' => 3,
102105
'version' => '2012-11-05',
103106
'lazy' => false,
107+
'endpoint' => null,
104108
],
105109
];
106110

@@ -114,6 +118,7 @@ public static function provideConfigs()
114118
'retries' => 3,
115119
'version' => '2012-11-05',
116120
'lazy' => false,
121+
'endpoint' => null,
117122
],
118123
];
119124

@@ -127,6 +132,27 @@ public static function provideConfigs()
127132
'retries' => 3,
128133
'version' => '2012-11-05',
129134
'lazy' => false,
135+
'endpoint' => null,
136+
],
137+
];
138+
139+
yield [
140+
[
141+
'key' => 'theKey',
142+
'secret' => 'theSecret',
143+
'token' => 'theToken',
144+
'lazy' => false,
145+
'endpoint' => 'http://localstack:1111',
146+
],
147+
[
148+
'key' => 'theKey',
149+
'secret' => 'theSecret',
150+
'token' => 'theToken',
151+
'region' => null,
152+
'retries' => 3,
153+
'version' => '2012-11-05',
154+
'lazy' => false,
155+
'endpoint' => 'http://localstack:1111',
130156
],
131157
];
132158
}

‎pkg/sqs/Tests/SqsConnectionFactoryTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testCouldBeConstructedWithEmptyConfiguration()
2828
'region' => null,
2929
'retries' => 3,
3030
'version' => '2012-11-05',
31+
'endpoint' => null,
3132
], 'config', $factory);
3233
}
3334

@@ -43,6 +44,7 @@ public function testCouldBeConstructedWithCustomConfiguration()
4344
'region' => null,
4445
'retries' => 3,
4546
'version' => '2012-11-05',
47+
'endpoint' => null,
4648
], 'config', $factory);
4749
}
4850

0 commit comments

Comments
 (0)