Skip to content

Commit 00d05ab

Browse files
authored
Merge pull request reactphp#422 from clue-labs/promise-compatibility
Backwards compatibility with Promise v1 API
2 parents 0ca61e6 + 71d5504 commit 00d05ab

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: php
22

33
php:
4+
# - 5.3 # requires old distro, see below
45
- 5.4
56
- 5.5
67
- 5.6
@@ -9,7 +10,13 @@ php:
910
- 7.2
1011
- hhvm
1112

13+
# lock distro so new future defaults will not break the build
14+
dist: trusty
15+
1216
matrix:
17+
include:
18+
- php: 5.3
19+
dist: precise
1320
allow_failures:
1421
- php: hhvm
1522

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"irc": "irc://irc.freenode.org/reactphp"
99
},
1010
"require": {
11-
"php": ">=5.4.0",
11+
"php": ">=5.3.8",
1212
"react/cache": "^0.5",
1313
"react/child-process": "^0.5",
1414
"react/dns": "^0.4",
1515
"react/event-loop": "^1.0",
1616
"react/http": "^0.8.1",
1717
"react/http-client": "^0.5",
18-
"react/promise": "^2.1",
18+
"react/promise": "^2.1 || ^1.2",
1919
"react/promise-stream": "^1.1.1",
2020
"react/socket": "^1.0",
2121
"react/stream": "^1.0"

tests/bootstrap.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,14 @@
1818

1919
// load all legacy test bootstrap scripts from React's components
2020
foreach (glob(__DIR__ . '/../vendor/react/*/tests/bootstrap.php') as $b) {
21+
// skip legacy react/promise for now and use manual autoload path from bootstrap config
22+
// @link https://github.com/reactphp/promise/blob/1.x/tests/bootstrap.php
23+
// @link https://github.com/reactphp/promise/blob/2.x/tests/bootstrap.php
24+
if (strpos($b, 'react/promise/tests/bootstrap.php') !== false) {
25+
$autoload->add('React\Promise', __DIR__ . '/../vendor/react/promise/tests');
26+
$autoload->addPsr4('React\\Promise\\', __DIR__ . '/../vendor/react/promise/tests');
27+
continue;
28+
}
29+
2130
include $b;
2231
}

0 commit comments

Comments
 (0)