summaryrefslogtreecommitdiff
path: root/bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh')
-rw-r--r--bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh b/bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh
new file mode 100644
index 00000000..2412031c
--- /dev/null
+++ b/bin/wiki/vendor/addwiki/mediawiki-api-base/build/travis/run-webserver.sh
@@ -0,0 +1,25 @@
+#! /bin/bash
+
+set -x
+
+# HHVM doesn't have a built in web server
+# We can't guarantee any single PHP version is always installed on Travis hosts
+# So list the versions and try to pick the latest PHP version
+# Also the web server on 7.1 seems to have issues, so don't use that?
+if [[ $TRAVIS_PHP_VERSION == *"hhvm"* ]] || [[ $TRAVIS_PHP_VERSION == *"7.1"* ]]
+then
+ WEBSERVERPHPVERSION=`phpenv versions | grep -v system | grep -v hhvm | grep -v 7.1 | tail -n 1 | xargs`
+ phpenv global $WEBSERVERPHPVERSION
+ php --version
+fi
+
+# Run a web server for MediaWiki and wait until it is up
+nohup php -S 0.0.0.0:8080 -t ./../web > /dev/null 2>&1 &
+until curl -s localhost:8080; do true; done > /dev/null 2>&1
+
+# Switch back to the actual php version requested for this build if needed
+if [ -v $WEBSERVERPHPVERSION ]
+then
+ phpenv global $TRAVIS_PHP_VERSION
+ php --version
+fi