Merge pull request #569 from zachborboa/master

Prevent direct execution of test server script
This commit is contained in:
Zach Borboa
2019-01-05 14:13:38 -08:00
committed by GitHub
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -1,4 +1,6 @@
<?php
// Prevent direct access unless testing.
getenv('PHP_CURL_CLASS_TEST_MODE_ENABLED') === 'yes' || exit;
require_once 'ContentRangeServer.php';
require_once 'RangeHeader.php';
+3
View File
@@ -40,6 +40,9 @@ else
fastcgi_pass="127.0.0.1:9000"
fi
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then
if ! [ -x "$(command -v add-apt-repository)" ]; then
$superuser apt-get install -y python-software-properties
+3
View File
@@ -3,6 +3,9 @@ cd "${SCRIPT_DIR}"
set -x
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
php -S 127.0.0.1:8000 -t PHPCurlClass/ &> /dev/null &
pid="${!}"
extra_args="${@}"