From: Michael Wallner Date: Mon, 5 Aug 2013 11:53:35 +0000 (+0200) Subject: add NEWS entry; add simple test X-Git-Tag: php-5.6.0alpha1~326^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a9d7c1f001a558ab0ebddb74e3b81d8d58b8095;p=php add NEWS entry; add simple test --- diff --git a/NEWS b/NEWS index c679b90a65..3ef4a979f1 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Improved IS_VAR operands fetching. (Laruence, Dmitry) . Implemented internal operator overloading (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) + . Enabled file uploads greater than 2G (Ralf Lang, Mike) - mysqlnd: . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 40c5361995..77a79e0f04 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -3,7 +3,7 @@ define ("PHP_CLI_SERVER_HOSTNAME", "localhost"); define ("PHP_CLI_SERVER_PORT", 8964); define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT); -function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) { +function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE, $cmd_args = null) { $php_executable = getenv('TEST_PHP_EXECUTABLE'); $doc_root = __DIR__; $router = "index.php"; @@ -19,14 +19,14 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) ); if (substr(PHP_OS, 0, 3) == 'WIN') { - $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); } else { - $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt new file mode 100644 index 0000000000..fe13d90007 --- /dev/null +++ b/sapi/cli/tests/upload_2G.phpt @@ -0,0 +1,99 @@ +--TEST-- +file upload greater than 2G +--SKIPIF-- +=8"); +} + +if ($f = fopen("/proc/meminfo","r")) { + while (!feof($f)) { + if (!strncmp($line = fgets($f), "MemFree", 7)) { + if (substr($line,8)/1024/1024 > 3) { + $enough_free_ram = true; + } + } + } +} + +if (empty($enough_free_ram)) { + die("need +3G free RAM"); +} +?> +--FILE-- + +Done +--EXPECTF-- +Test + +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: PHP/%s +Content-type: text/html + +array(1) { + ["file1"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(14) "/tmp/php%s" + ["error"]=> + int(0) + ["size"]=> + int(2150000000) + } +} +Done