Files
php-curl-class/tests/before_script.sh
T
2014-08-16 23:26:37 -07:00

43 lines
1.6 KiB
Bash

if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then
sudo add-apt-repository -y ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
sudo apt-get install -y php5-fpm
root="$(pwd)/tests/PHPCurlClass"
sudo tee /etc/nginx/sites-enabled/default <<EOF
server {
listen 8000 default_server;
root ${root};
index index.php;
server_name localhost;
location / {
try_files \$uri \$uri/ /index.php =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
EOF
sudo /etc/init.d/nginx restart
elif [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "hhvm" ]]; then
sudo add-apt-repository -y ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
sudo /usr/share/hhvm/install_fastcgi.sh
root="$(pwd)/tests/PHPCurlClass"
root="${root//\//\\/}"
sudo sed --in-place --regexp-extended 's/listen 80 default_server;/listen 8000 default_server;/' /etc/nginx/sites-enabled/default
sudo sed --in-place --regexp-extended "s/root \/usr\/share\/nginx\/html;/root ${root};/" /etc/nginx/sites-enabled/default
sudo sed --in-place --regexp-extended 's/index index.html index.htm;/index index.php;/' /etc/nginx/sites-enabled/default
sudo /etc/init.d/nginx restart
fi