nlopess Thu Sep 14 17:07:41 2006 UTC Modified files: /php-src run-tests.php /php-src/tests/run-test test010.phpt Log: MFB http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.306&r2=1.307&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.306 php-src/run-tests.php:1.307 --- php-src/run-tests.php:1.306 Wed Aug 23 07:02:26 2006 +++ php-src/run-tests.php Thu Sep 14 17:07:41 2006 @@ -23,7 +23,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: run-tests.php,v 1.306 2006/08/23 07:02:26 tony2001 Exp $ */ +/* $Id: run-tests.php,v 1.307 2006/09/14 17:07:41 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -400,7 +400,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.306 $'."\n"; + echo '$Revision: 1.307 $'."\n"; exit(1); default: echo "Illegal switch specified!\n"; @@ -841,7 +841,7 @@ } } -function system_with_timeout($commandline, $env = null) +function system_with_timeout($commandline, $env = null, $stdin = null) { global $leak_check; @@ -856,6 +856,9 @@ if (!$proc) return false; + if (is_string($stdin)) { + fwrite($pipes[0], $stdin); + } fclose($pipes[0]); while (true) { @@ -1400,7 +1403,7 @@ COMMAND $cmd "; - $out = system_with_timeout($cmd, $env); + $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null); if (array_key_exists('CLEAN', $section_text) && (!$no_clean || $cfg['keep']['clean'])) { if (trim($section_text['CLEAN'])) { http://cvs.php.net/viewvc.cgi/php-src/tests/run-test/test010.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/tests/run-test/test010.phpt diff -u /dev/null php-src/tests/run-test/test010.phpt:1.2 --- /dev/null Thu Sep 14 17:07:41 2006 +++ php-src/tests/run-test/test010.phpt Thu Sep 14 17:07:41 2006 @@ -0,0 +1,17 @@ +--TEST-- +STDIN input +--FILE-- +<?php +var_dump(stream_get_contents(STDIN)); +var_dump(stream_get_contents(fopen('php://stdin', 'r'))); +var_dump(file_get_contents('php://stdin')); +?> +--STDIN-- +fooBar +use this to input some thing to the php script +--EXPECT-- +string(54) "fooBar +use this to input some thing to the php script +" +string(0) "" +string(0) ""
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php