Skip to content

Commit

Permalink
Merge branch 'kenxx-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Sep 4, 2020
2 parents 4739e26 + bded994 commit a20f6f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ matrix:
local fold=$(date +%s%N)
echo -e "travis_fold:start:$fold"
echo -e "\\e[1;34m$title\\e[0m"
echo "./tests/install.sh \"$1\" \"$2\" \"$3\""
./tests/install.sh "$1" "$2" "$3" 2>&1
echo "./tests/install.sh \"$1\" \"$2\" \"$3\" \"$4\""
./tests/install.sh "$1" "$2" "$3" "$4" 2>&1
local ok=$?
(exit $ok) &&
echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
Expand Down Expand Up @@ -88,6 +88,8 @@ matrix:
- install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "http-interop/http-factory-guzzle:1.*"
# Test that we find PSR-17 nyholm
- install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "nyholm/psr7:^1.3"
# Test that we find Phalcon with PSR
- install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "" "psr-1.0.0 phalcon-4.0.6"

before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
Expand Down
6 changes: 6 additions & 0 deletions src/Strategy/CommonPsr17ClassesStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
*/
private static $classes = [
RequestFactoryInterface::class => [
'Phalcon\Http\Message\RequestFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\RequestFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand All @@ -30,6 +31,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
'Laminas\Diactoros\RequestFactory',
],
ResponseFactoryInterface::class => [
'Phalcon\Http\Message\ResponseFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\ResponseFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand All @@ -39,6 +41,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
'Laminas\Diactoros\ResponseFactory',
],
ServerRequestFactoryInterface::class => [
'Phalcon\Http\Message\ServerRequestFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\ServerRequestFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand All @@ -48,6 +51,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
'Laminas\Diactoros\ServerRequestFactory',
],
StreamFactoryInterface::class => [
'Phalcon\Http\Message\StreamFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\StreamFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand All @@ -57,6 +61,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
'Laminas\Diactoros\StreamFactory',
],
UploadedFileFactoryInterface::class => [
'Phalcon\Http\Message\UploadedFileFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\UploadedFileFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand All @@ -66,6 +71,7 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
'Laminas\Diactoros\UploadedFileFactory',
],
UriFactoryInterface::class => [
'Phalcon\Http\Message\UriFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
'Zend\Diactoros\UriFactory',
'GuzzleHttp\Psr7\HttpFactory',
Expand Down
7 changes: 6 additions & 1 deletion tests/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ mkdir -p $BUILD_DIR
composer init --working-dir $BUILD_DIR --no-interaction
composer req --working-dir $BUILD_DIR php-http/discovery --no-update

# Define packages from arguments
# Argument 3 installs additional composer packages
composer req --working-dir $BUILD_DIR $3

# Arg 4 means some pecl things will be install
if ! [ -z "$4" ]; then
pecl install $4
fi

# Copy the current version of php-http/discovery
cp -R src $BUILD_DIR/vendor/php-http/discovery
cd $BUILD_DIR
Expand Down

0 comments on commit a20f6f7

Please sign in to comment.