Commit: fb27e16f01a4b96deaec6eb237f26753ae2a27ee Author: Anatol Belski <a...@php.net> Thu, 21 Nov 2013 11:54:35 +0100 Parents: c63f8bdfba87edeb2c31c043b04977fb8275490d Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fb27e16f01a4b96deaec6eb237f26753ae2a27ee Log: fixed the skipif part Changed paths: M sapi/cli/tests/upload_2G.phpt Diff: diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt index b8416ea..a172ccd 100644 --- a/sapi/cli/tests/upload_2G.phpt +++ b/sapi/cli/tests/upload_2G.phpt @@ -8,18 +8,36 @@ if (PHP_INT_SIZE < 8) { die("skip need PHP_INT_SIZE>=8"); } -if ($f = fopen("/proc/meminfo","r")) { +$enough_free_ram = false; +if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + exec("c:\\Windows\\System32\\systeminfo.exe", $out); + + foreach($out as $ln) { + $s = "Virtual Memory: Available:"; + if (false !== strpos($ln, $s)) { + $p = "/$s\s*([0-9,\.]+)\*s/"; + if (preg_match("/$s\s*([0-9,\.]+)/", $ln, $m)) { + $ram = str_replace(array(",", "."), "", $m[1])/1024; + if ($ram > 3) { + $enough_free_ram = true; + break; + } + } + } + } +} else 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; + break; } } } } if (empty($enough_free_ram)) { - die("need +3G free RAM"); + die("skip need +3G free RAM"); } ?> --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php