mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Fix #449: Fix hhvm builds failing.
Install latest nginx. Replace install_fastcgi.sh which inserts "include hhvm.conf;" with inline configuration. Copy server scripts to default nginx root instead of modifying folder and file permissions to fix nginx 404 File Not Found.
This commit is contained in:
+1
-3
@@ -2,8 +2,6 @@ language: php
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
- php: hhvm-nightly
|
||||
- php: nightly
|
||||
include:
|
||||
- php: 5.3
|
||||
@@ -16,7 +14,7 @@ matrix:
|
||||
dist: trusty
|
||||
- php: hhvm-nightly
|
||||
dist: trusty
|
||||
- nightly
|
||||
- php: nightly
|
||||
|
||||
before_script:
|
||||
- bash tests/before_script.sh
|
||||
|
||||
+15
-8
@@ -69,27 +69,34 @@ elif [[ "${TRAVIS_PHP_VERSION}" == "7.0" ]]; then
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "7.1" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "hhvm" || "${TRAVIS_PHP_VERSION}" == "hhvm-nightly" ]]; then
|
||||
sudo add-apt-repository -y ppa:nginx/stable
|
||||
curl "https://nginx.org/keys/nginx_signing.key" | sudo apt-key add -
|
||||
echo "deb https://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
|
||||
echo "deb-src https://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y nginx
|
||||
root="$(pwd)/tests/PHPCurlClass"
|
||||
sudo tee /etc/nginx/sites-enabled/default <<EOF
|
||||
sudo tee /etc/nginx/conf.d/default.conf <<"EOF"
|
||||
server {
|
||||
listen 8000 default_server;
|
||||
root ${root};
|
||||
index index.php;
|
||||
server_name localhost;
|
||||
root /usr/share/nginx/html;
|
||||
location / {
|
||||
rewrite ^ /index.php last;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
sudo /usr/share/hhvm/install_fastcgi.sh
|
||||
sudo /etc/init.d/hhvm restart
|
||||
sleep 5
|
||||
sudo service nginx stop
|
||||
sleep 5
|
||||
sudo service nginx start
|
||||
|
||||
script_dir="$(dirname "$(readlink -f "$0")")"
|
||||
root="${script_dir}/PHPCurlClass"
|
||||
sudo cp -v "${root}/"* "/usr/share/nginx/html/"
|
||||
|
||||
phpunit_shim
|
||||
|
||||
# Use an older version of PHPUnit for HHVM builds so that unit tests can be
|
||||
@@ -98,7 +105,7 @@ EOF
|
||||
# Avoids error:
|
||||
# This version of PHPUnit is supported on PHP 7.0 and PHP 7.1.
|
||||
# You are using PHP 5.6.99-hhvm (/usr/bin/hhvm).
|
||||
composer require phpunit/phpunit:5.7
|
||||
composer require phpunit/phpunit:5.7.*
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "nightly" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
fi
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ EOF
|
||||
php --run "${script}" "${filename}"
|
||||
}
|
||||
# Skip hhvm "Notice: File could not be loaded: ..."
|
||||
if [[ "${TRAVIS_PHP_VERSION}" != "hhvm" ]]; then
|
||||
if [[ "${TRAVIS_PHP_VERSION}" != "hhvm" ]] && [[ "${TRAVIS_PHP_VERSION}" != "hhvm-nightly" ]]; then
|
||||
export -f "find_invalid_indentation"
|
||||
invalid_indentation=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec bash -c 'find_invalid_indentation "{}"' \;)
|
||||
if [[ ! -z "${invalid_indentation}" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user