diff --git a/cli-script.php b/cli-script.php index e4391c619d7..2534bf68872 100755 --- a/cli-script.php +++ b/cli-script.php @@ -37,7 +37,8 @@ */ if(isset($_SERVER['argv'][2])) { $args = array_slice($_SERVER['argv'],2); - $_GET = array(); + if(!isset($_GET)) $_GET = array(); + if(!isset($_REQUEST)) $_REQUEST = array(); foreach($args as $arg) { if(strpos($arg,'=') == false) { $_GET['args'][] = $arg; @@ -47,7 +48,7 @@ $_GET = array_merge($_GET, $newItems); } } - $_REQUEST = $_GET; + $_REQUEST = array_merge($_REQUEST, $_GET); } // Set 'url' GET parameter diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 199b9821c6b..490a1a0c242 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -28,7 +28,8 @@ // Copied from cli-script.php, to enable same behaviour through phpunit runner. if(isset($_SERVER['argv'][2])) { $args = array_slice($_SERVER['argv'],2); - $_GET = array(); + if(!isset($_GET)) $_GET = array(); + if(!isset($_REQUEST)) $_REQUEST = array(); foreach($args as $arg) { if(strpos($arg,'=') == false) { $_GET['args'][] = $arg; @@ -38,7 +39,7 @@ $_GET = array_merge($_GET, $newItems); } } - $_REQUEST = $_GET; + $_REQUEST = array_merge($_REQUEST, $_GET); } // Always flush the manifest for phpunit test runs