Skip to content

Commit d8a0c07

Browse files
authored
Merge pull request #48 from php-http/feature/remove-async
Remove support for async extension
2 parents 7770fd3 + d730acd commit d8a0c07

8 files changed

+9
-61
lines changed

.travis.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ cache:
77
- $HOME/.composer/cache
88

99
php:
10-
- 7.1
1110
- 7.2
1211
- 7.3
12+
- 7.4
1313

1414
env:
1515
global:
@@ -22,18 +22,13 @@ branches:
2222
matrix:
2323
fast_finish: true
2424
include:
25-
- php: 7.1
25+
- php: 7.2
2626
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
2727
- php: 7.2
2828
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
29-
- php: 7.3
30-
env: USE_ASYNC=true
3129

3230
before_install:
3331
- travis_retry composer self-update
34-
- if [[ "$USE_ASYNC" = true ]]; then git clone https://github.com/concurrent-php/ext-async.git /tmp/async; fi
35-
- if [[ "$USE_ASYNC" = true ]]; then cd /tmp/async && phpize && ./configure && sudo make install; fi
36-
- if [[ "$USE_ASYNC" = true ]]; then echo "extension = async.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini && php -m && cd $TRAVIS_BUILD_DIR; fi
3732

3833
install:
3934
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction --ignore-platform-reqs
@@ -44,7 +39,6 @@ before_script:
4439
script:
4540
- cd ./tests/server/ssl && ./generate.sh && pwd && ls -la && cd ../../../
4641
- $TEST_COMMAND
47-
- ./vendor/bin/phpunit tests/SocketClientFeatureTest.php --printer Http\\Client\\Tests\\FeatureTestListener || echo ""
4842

4943
after_success:
5044
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## 2.0.0 (unreleased)
3+
## 2.0.0
44

55
* Remove response and stream factory, use direct implementation of nyholm/psr7
66
* Async support with ext-async extension: see https://github.com/concurrent-php/ext-async
@@ -20,7 +20,7 @@
2020
* `ConnectionException`
2121
* `InvalidRequestException`
2222
* `SSLConnectionException`
23-
23+
2424
## 1.2.0
2525

2626
* Dropped PHP 5.4 support

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
"symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0"
1717
},
1818
"require-dev": {
19-
"concurrent-php/async-api": "dev-master",
2019
"friendsofphp/php-cs-fixer": "^2.2",
2120
"php-http/client-integration-tests": "dev-master",
2221
"php-http/message": "^1.0",
2322
"php-http/client-common": "^2.0"
2423
},
2524
"provide": {
26-
"php-http/client-implementation": "1.0"
25+
"php-http/client-implementation": "1.0",
26+
"psr/http-client": "1.0"
2727
},
2828
"autoload": {
2929
"psr-4": {

src/Client.php

-9
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class Client implements HttpClient
3434
'ssl_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
3535
];
3636

37-
private $hasAsync;
38-
3937
/**
4038
* Constructor.
4139
*
@@ -52,8 +50,6 @@ class Client implements HttpClient
5250
*/
5351
public function __construct($config1 = [], $config2 = null, array $config = [])
5452
{
55-
$this->hasAsync = PHP_VERSION_ID >= 70300 && \extension_loaded('async');
56-
5753
if (\is_array($config1)) {
5854
$this->config = $this->configure($config1);
5955

@@ -171,7 +167,6 @@ protected function configure(array $config = [])
171167
/**
172168
* Return remote socket from the request.
173169
*
174-
*
175170
* @throws InvalidRequestException When no remote can be determined from the request
176171
*
177172
* @return string
@@ -191,10 +186,6 @@ private function determineRemoteFromRequest(RequestInterface $request)
191186
$endpoint = $request->getHeaderLine('Host');
192187
}
193188

194-
if ($this->hasAsync) {
195-
return sprintf('async-tcp://%s', $endpoint);
196-
}
197-
198189
return sprintf('tcp://%s', $endpoint);
199190
}
200191
}

tests/AsyncTest.php

-37
This file was deleted.

tests/SocketClientFeatureTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Http\Client\Socket\Tests;
44

5-
use Http\Client\Tests\HttpFeatureTest;
65
use Http\Client\Socket\Client as SocketHttpClient;
6+
use Http\Client\Tests\HttpFeatureTest;
77
use Psr\Http\Client\ClientInterface;
88

99
class SocketClientFeatureTest extends HttpFeatureTest

tests/SocketHttpAdapterTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Http\Client\Socket\Tests;
44

5-
use Http\Client\Tests\HttpClientTest;
65
use Http\Client\Socket\Client as SocketHttpClient;
6+
use Http\Client\Tests\HttpClientTest;
77
use Psr\Http\Client\ClientInterface;
88

99
class SocketHttpAdapterTest extends HttpClientTest

tests/SocketHttpClientTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Http\Client\Socket\Tests;
44

55
use Http\Client\Common\HttpMethodsClient;
6-
use Http\Message\MessageFactory\GuzzleMessageFactory;
76
use Http\Client\Socket\Client as SocketHttpClient;
7+
use Http\Message\MessageFactory\GuzzleMessageFactory;
88

99
class SocketHttpClientTest extends BaseTestCase
1010
{

0 commit comments

Comments
 (0)