aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/check-executable-files.sh69
-rwxr-xr-xtravis/check-image-icc-profiles.sh21
-rwxr-xr-xtravis/check-sami-parse-errors.sh34
-rwxr-xr-xtravis/ext-sniff.sh27
-rwxr-xr-xtravis/install-phpbb-test-dependencies.sh16
-rwxr-xr-xtravis/phing-sniff.sh23
-rw-r--r--travis/phpunit-mariadb-travis.xml10
-rw-r--r--travis/phpunit-mysql-travis.xml15
-rw-r--r--travis/phpunit-mysqli-travis.xml46
-rw-r--r--travis/phpunit-postgres-travis.xml12
-rw-r--r--travis/phpunit-sqlite3-travis.xml46
-rwxr-xr-xtravis/prepare-extension.sh22
-rwxr-xr-xtravis/setup-database.sh37
-rwxr-xr-xtravis/setup-exiftool.sh14
-rwxr-xr-xtravis/setup-mariadb.sh9
-rwxr-xr-xtravis/setup-php-extensions.sh23
-rwxr-xr-xtravis/setup-phpbb.sh42
-rwxr-xr-xtravis/setup-unbuffer.sh14
-rwxr-xr-xtravis/setup-webserver.sh81
19 files changed, 504 insertions, 57 deletions
diff --git a/travis/check-executable-files.sh b/travis/check-executable-files.sh
new file mode 100755
index 0000000000..1aa8dca073
--- /dev/null
+++ b/travis/check-executable-files.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+root="$4"
+path="${root}phpBB/"
+
+if [ "$NOTESTS" == '1' ]
+then
+ # Check the permissions of the files
+
+ # The following variables MUST NOT contain any wildcard
+ # Directories to skip
+ directories_skipped="-path ${path}develop -o -path ${path}vendor"
+
+ # Files to skip
+ files_skipped="-false"
+
+ # Files which have to be executable
+ executable_files="-path ${path}bin/* -o -path ${path}install/phpbbcli.php"
+
+ incorrect_files=$( \
+ find ${path} \
+ '(' \
+ '(' \
+ ${directories_skipped} \
+ ')' \
+ -a -type d -prune -a -type f \
+ ')' -o \
+ '(' \
+ -type f -a \
+ -not '(' \
+ ${files_skipped} \
+ ')' -a \
+ '(' \
+ '(' \
+ '(' \
+ ${executable_files} \
+ ')' -a \
+ -not -perm +100 \
+ ')' -o \
+ '(' \
+ -not '(' \
+ ${executable_files} \
+ ')' -a \
+ -perm +111 \
+ ')' \
+ ')' \
+ ')' \
+ )
+
+ if [ "${incorrect_files}" != '' ]
+ then
+ echo "The following files do not have proper permissions:";
+ ls -la ${incorrect_files}
+ exit 1;
+ fi
+fi
diff --git a/travis/check-image-icc-profiles.sh b/travis/check-image-icc-profiles.sh
new file mode 100755
index 0000000000..05c7de2d27
--- /dev/null
+++ b/travis/check-image-icc-profiles.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+
+if [ "$NOTESTS" == '1' ]
+then
+ find . -type f -a -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' -a -not -wholename '*vendor/*' | \
+ parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}'
+fi
diff --git a/travis/check-sami-parse-errors.sh b/travis/check-sami-parse-errors.sh
new file mode 100755
index 0000000000..4cc2cee525
--- /dev/null
+++ b/travis/check-sami-parse-errors.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+
+if [ "$NOTESTS" == '1' ]
+then
+ # Workarounds for
+ # https://github.com/fabpot/Sami/issues/116
+ # and
+ # https://github.com/fabpot/Sami/issues/117
+ errors=$(
+ unbuffer phpBB/vendor/bin/sami.php parse build/sami-checkout.conf.php -v | \
+ sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | \
+ grep "ERROR: " | \
+ tee /dev/tty | \
+ wc -l
+ )
+ if [ "$errors" != "0" ]
+ then
+ exit 1
+ fi
+fi
diff --git a/travis/ext-sniff.sh b/travis/ext-sniff.sh
new file mode 100755
index 0000000000..61ceda6834
--- /dev/null
+++ b/travis/ext-sniff.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+EXTNAME=$3
+
+if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ]
+then
+ phpBB/vendor/bin/phpcs \
+ -s \
+ --extensions=php \
+ --standard=build/code_sniffer/ruleset-php-extensions.xml \
+ "--ignore=phpBB/ext/$EXTNAME/tests/*" \
+ "--ignore=phpBB/ext/$EXTNAME/vendor/*" \
+ "phpBB/ext/$EXTNAME"
+fi
diff --git a/travis/install-phpbb-test-dependencies.sh b/travis/install-phpbb-test-dependencies.sh
new file mode 100755
index 0000000000..25743ff2b1
--- /dev/null
+++ b/travis/install-phpbb-test-dependencies.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+cd tests
+php ../composer.phar install --dev --no-interaction --prefer-source
+cd ..
diff --git a/travis/phing-sniff.sh b/travis/phing-sniff.sh
new file mode 100755
index 0000000000..3f43b64130
--- /dev/null
+++ b/travis/phing-sniff.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+
+if [ "$NOTESTS" == '1' ]
+then
+ cd build
+ ../phpBB/vendor/bin/phing sniff
+ cd ..
+fi
diff --git a/travis/phpunit-mariadb-travis.xml b/travis/phpunit-mariadb-travis.xml
index 1eaee5b7d8..53a206b9b0 100644
--- a/travis/phpunit-mariadb-travis.xml
+++ b/travis/phpunit-mariadb-travis.xml
@@ -13,13 +13,17 @@
bootstrap="../tests/bootstrap.php">
<testsuites>
<testsuite name="phpBB Test Suite">
- <directory suffix="_test.php">../tests/</directory>
- <exclude>tests/functional</exclude>
- <exclude>tests/lint_test.php</exclude>
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
index 5fa6c06e46..d0d3e3c0c0 100644
--- a/travis/phpunit-mysql-travis.xml
+++ b/travis/phpunit-mysql-travis.xml
@@ -13,16 +13,17 @@
bootstrap="../tests/bootstrap.php">
<testsuites>
<testsuite name="phpBB Test Suite">
- <directory suffix="_test.php">../tests/</directory>
- <exclude>tests/functional</exclude>
- <exclude>tests/lint_test.php</exclude>
- </testsuite>
- <testsuite name="phpBB Lint Test">
- <file>tests/lint_test.php</file>
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -32,7 +33,7 @@
</groups>
<php>
- <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" />
+ <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysql" />
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
<server name="PHPBB_TEST_DBPORT" value="3306" />
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml
new file mode 100644
index 0000000000..b12ae6fe8b
--- /dev/null
+++ b/travis/phpunit-mysqli-travis.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ verbose="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
+ </testsuite>
+ <testsuite name="phpBB Functional Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
+ </testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" />
+ <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
+ <server name="PHPBB_TEST_DBPORT" value="3306" />
+ <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
+ <server name="PHPBB_TEST_DBUSER" value="root" />
+ <server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
+ </php>
+</phpunit>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
index 88d9e0f46a..fa497a1264 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -13,13 +13,17 @@
bootstrap="../tests/bootstrap.php">
<testsuites>
<testsuite name="phpBB Test Suite">
- <directory suffix="_test.php">../tests/</directory>
- <exclude>tests/functional</exclude>
- <exclude>tests/lint_test.php</exclude>
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -29,8 +33,6 @@
</groups>
<php>
- <!-- "Real" test database -->
- <!-- uncomment, otherwise sqlite memory runs -->
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost" />
<server name="PHPBB_TEST_DBPORT" value="5432" />
diff --git a/travis/phpunit-sqlite3-travis.xml b/travis/phpunit-sqlite3-travis.xml
new file mode 100644
index 0000000000..5baab791e0
--- /dev/null
+++ b/travis/phpunit-sqlite3-travis.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ verbose="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
+ </testsuite>
+ <testsuite name="phpBB Functional Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
+ </testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <!--server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\sqlite3" /-->
+ <!--server name="PHPBB_TEST_DBHOST" value="../phpbb_unit_tests.sqlite3" /-->
+ <!--server name="PHPBB_TEST_DBPORT" value="" /-->
+ <!--server name="PHPBB_TEST_DBNAME" value="" /-->
+ <!--server name="PHPBB_TEST_DBUSER" value="" /-->
+ <!--server name="PHPBB_TEST_DBPASSWD" value="" /-->
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
+ </php>
+</phpunit>
diff --git a/travis/prepare-extension.sh b/travis/prepare-extension.sh
new file mode 100755
index 0000000000..4518f935f8
--- /dev/null
+++ b/travis/prepare-extension.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+EXTNAME=$1
+BRANCH=$2
+
+# Move the extension in place
+mkdir --parents phpBB/ext/$EXTNAME
+cp -R ../tmp/* phpBB/ext/$EXTNAME
+
+# Move the extensions travis/phpunit-*-travis.xml files in place
+cp -R travis/* phpBB/ext/$EXTNAME/travis
diff --git a/travis/setup-database.sh b/travis/setup-database.sh
new file mode 100755
index 0000000000..3771f19073
--- /dev/null
+++ b/travis/setup-database.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+
+if [ "$NOTESTS" == '1' ]
+then
+ exit 0
+fi
+
+if [ "$DB" == "postgres" ]
+then
+ psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres
+ psql -c 'create database phpbb_tests;' -U postgres
+fi
+
+if [ "$TRAVIS_PHP_VERSION" == "5.4" -a "$DB" == "mysqli" ]
+then
+ mysql -e 'SET GLOBAL storage_engine=MyISAM;'
+fi
+
+if [ "$DB" == "mysql" -o "$DB" == "mysqli" -o "$DB" == "mariadb" ]
+then
+ mysql -e 'create database IF NOT EXISTS phpbb_tests;'
+fi
diff --git a/travis/setup-exiftool.sh b/travis/setup-exiftool.sh
new file mode 100755
index 0000000000..04999b8600
--- /dev/null
+++ b/travis/setup-exiftool.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+sudo apt-get update
+sudo apt-get install -y parallel libimage-exiftool-perl
diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh
index aceb6af7ee..9bc487915d 100755
--- a/travis/setup-mariadb.sh
+++ b/travis/setup-mariadb.sh
@@ -1,7 +1,12 @@
#!/bin/bash
#
-# @copyright (c) 2013 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
set -e
set -x
diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh
index 86e3aaae47..d9544858b7 100755
--- a/travis/setup-php-extensions.sh
+++ b/travis/setup-php-extensions.sh
@@ -1,7 +1,12 @@
#!/bin/bash
#
-# @copyright (c) 2013 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
set -e
set -x
@@ -37,20 +42,18 @@ function install_php_extension
php_ini_file=$(find_php_ini)
-# disable broken opcache on PHP 5.5.7 and 5.5.8
-if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.9', '<');"` == "1" ]
-then
- sed -i '/opcache.so/d' "$php_ini_file"
-fi
-
# apc
if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ]
then
echo 'Enabling APC PHP extension'
register_php_extension 'apc' "$php_ini_file"
echo 'apc.enable_cli=1' >> "$php_ini_file"
+else
+ echo 'Disabling Opcache'
+ echo 'opcache.enable=0' >> "$php_ini_file"
fi
# redis
-git clone git://github.com/nicolasff/phpredis.git redis
-install_php_extension 'redis' "$php_ini_file"
+# Disabled redis for now as it causes travis to fail
+# git clone git://github.com/nicolasff/phpredis.git redis
+# install_php_extension 'redis' "$php_ini_file"
diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh
new file mode 100755
index 0000000000..30f79ee0cb
--- /dev/null
+++ b/travis/setup-phpbb.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+NOTESTS=$3
+
+if [ "$NOTESTS" == '1' ]
+then
+ travis/setup-exiftool.sh
+ travis/setup-unbuffer.sh
+fi
+
+if [ "$DB" == "mariadb" ]
+then
+ travis/setup-mariadb.sh
+fi
+
+if [ "$NOTESTS" != '1' -a "$TRAVIS_PHP_VERSION" != "hhvm" ]
+then
+ travis/setup-php-extensions.sh
+fi
+
+if [ "$NOTESTS" != '1' ]
+then
+ travis/setup-webserver.sh
+ travis/install-phpbb-test-dependencies.sh
+fi
+
+cd phpBB
+php ../composer.phar install --dev --no-interaction --prefer-source
+cd ..
diff --git a/travis/setup-unbuffer.sh b/travis/setup-unbuffer.sh
new file mode 100755
index 0000000000..4423d1b8b6
--- /dev/null
+++ b/travis/setup-unbuffer.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+sudo apt-get update
+sudo apt-get install -y expect-dev
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index f1bf69c575..911ba12f3c 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -1,7 +1,12 @@
#!/bin/bash
#
-# @copyright (c) 2013 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
set -e
set -x
@@ -12,44 +17,60 @@ sudo apt-get install -y nginx realpath
sudo service nginx stop
DIR=$(dirname "$0")
+USER=$(whoami)
PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
-
NGINX_CONF="/etc/nginx/sites-enabled/default"
+APP_SOCK=$(realpath "$DIR")/php-app.sock
-PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
-PHP_FPM_CONF="$DIR/php-fpm.conf"
-PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ]
+then
+ HHVM_LOG=$(realpath "$DIR")/hhvm.log
-USER=$(whoami)
+ sudo service hhvm stop
+ sudo hhvm \
+ --mode daemon \
+ --user "$USER" \
+ -vServer.Type=fastcgi \
+ -vServer.FileSocket="$APP_SOCK" \
+ -vLog.File="$HHVM_LOG"
+else
+ # php-fpm
+ PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
+ PHP_FPM_CONF="$DIR/php-fpm.conf"
-# php-fpm configuration
-echo "
-[global]
+ echo "
+ [global]
-[travis]
-user = $USER
-group = $USER
-listen = $PHP_FPM_SOCK
-pm = static
-pm.max_children = 2
+ [travis]
+ user = $USER
+ group = $USER
+ listen = $APP_SOCK
+ listen.mode = 0666
+ pm = static
+ pm.max_children = 2
-php_admin_value[memory_limit] = 128M
-" > $PHP_FPM_CONF
+ php_admin_value[memory_limit] = 128M
+ " > $PHP_FPM_CONF
-# nginx configuration
+ sudo $PHP_FPM_BIN \
+ --fpm-config "$DIR/php-fpm.conf"
+fi
+
+# nginx
echo "
-server {
- listen 80;
- root $PHPBB_ROOT_PATH/;
- index index.php index.html;
-
- location ~ \.php {
- fastcgi_pass unix:$PHP_FPM_SOCK;
- include fastcgi_params;
+ server {
+ listen 80;
+ root $PHPBB_ROOT_PATH/;
+ index index.php index.html;
+
+ location ~ \.php {
+ include fastcgi_params;
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ fastcgi_param PATH_INFO \$fastcgi_path_info;
+ fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
+ fastcgi_pass unix:$APP_SOCK;
+ }
}
-}
" | sudo tee $NGINX_CONF > /dev/null
-# Start daemons
-sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf"
sudo service nginx start