mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 12:43:14 +00:00
Fix #562: Prevent direct execution of test server script unless testing
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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,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="${@}"
|
||||
|
||||
Reference in New Issue
Block a user