Hello Pierre-Alain,

  i don't have /home/pierre on my machine and i will never have that.
Please respect the rule to this one file: only authors are allowed
to commit to this (check the archieves). The rule is there for a reason.

Wednesday, May 3, 2006, 11:33:45 PM, you wrote:

> pajoye          Wed May  3 21:33:45 2006 UTC

>   Modified files:              (Branch: PHP_5_1)
>     /php-src    run-tests.php 
>   Log:
>   - add support for POST_RAW, allow to pass raw POST data
>   - add support for TEST_PHP_CGI_EXECUTABLE env variable, it is now possible
>     to set both TEST_PHP_EXECUTABLE and CGI
>   
>   
> http://cvs.php.net/viewcvs.cgi/php-src/run-tests.php?r1=1.226.2.35&r2=1.226.2.36&diff_format=u
> Index: php-src/run-tests.php
> diff -u php-src/run-tests.php:1.226.2.35 php-src/run-tests.php:1.226.2.36
> --- php-src/run-tests.php:1.226.2.35    Sat Mar 11 18:13:37 2006
> +++ php-src/run-tests.php       Wed May  3 21:33:44 2006
> @@ -23,7 +23,7 @@
>     +----------------------------------------------------------------------+
>   */
>  
> -/* $Id: run-tests.php,v 1.226.2.35 2006/03/11 18:13:37 helly Exp $ */
> +/* $Id: run-tests.php,v 1.226.2.36 2006/05/03 21:33:44 pajoye 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
> @@ -112,6 +112,15 @@
>         $environment['TEST_PHP_EXECUTABLE'] = $php;
>  }
>  
> +if (getenv('TEST_PHP_CGI_EXECUTABLE')) {
> +       $php_cgi = getenv('TEST_PHP_CGI_EXECUTABLE');
> +       if ($php_cgi=='auto') {
> +               $php_cgi = $cwd.'/sapi/cgi/php';
> +               putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi");
> +       }
> +       $environment['TEST_PHP_CGI_EXECUTABLE'] = $php_cgi;
> +}
> +
>  if ($argc !=2 || ($argv[1] != '-h' && $argv[1] != '-help' && $argv != 
> '--help'))
>  {
>         if (empty($php) || !file_exists($php)) {
> @@ -388,7 +397,7 @@
>                                         $html_output = 
> is_resource($html_file);
>                                         break;
>                                 case '--version':
> -                                       echo '$Revision: 1.226.2.35 $'."\n";
> +                                       echo '$Revision: 1.226.2.36 $'."\n";
>                                         exit(1);
>                                 default:
>                                         echo "Illegal switch '$switch' 
> specified!\n";
> @@ -919,7 +928,11 @@
>  
>         $temp_filenames = null;
>         $org_file = $file;
> -       
> +
> +       if (isset($env['TEST_PHP_CGI_EXECUTABLE'])) {
> +               $php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'];
> +       }
> +
>         if (is_array($file)) $file = $file[0];
>  
>         if ($DETAILED) echo "
> @@ -932,7 +945,9 @@
>                 'TEST'   => '',
>                 'SKIPIF' => '',
>                 'GET'    => '',
> +               'POST_RAW' => '',
>                 'POST'   => '',
> +               'UPLOAD' => '',
>                 'ARGS'   => '',
>         );
>  
> @@ -957,7 +972,7 @@
>                 $line = fgets($fp);
>  
>                 // Match the beginning of a section.
> -               if (preg_match('/^--([A-Z]+)--/', $line, $r)) {
> +               if (preg_match('/^--([A-Z_]+)--/', $line, $r)) {
>                         $section = $r[1];
>                         $section_text[$section] = '';
>                         $secfile = $section == 'FILE' || $section == 
> 'FILEEOF';
> @@ -1019,8 +1034,11 @@
>         $tested = trim($section_text['TEST']);
>  
>         /* For GET/POST tests, check if cgi sapi is available and if it is, 
> use it. */
> -       if ((!empty($section_text['GET']) || !empty($section_text['POST']))) {
> -               if (!strncasecmp(PHP_OS, "win", 3) &&
> file_exists(dirname($php) ."/php-cgi.exe")) {
> +       if (!empty($section_text['GET']) || !empty($section_text['POST'])
> || !empty($section_text['POST_RAW'])) {
> +               if (isset($php_cgi)) {
> +                       $old_php = $php;
> +                       $php = $php_cgi .' -C ';
> +               } elseif (!strncasecmp(PHP_OS, "win", 3) &&
> file_exists(dirname($php) ."/php-cgi.exe")) {
>                         $old_php = $php;
>                         $php = realpath(dirname($php) ."/php-cgi.exe") .' -C 
> ';
>                 } elseif (file_exists("./sapi/cgi/php")) {
> @@ -1256,18 +1274,39 @@
>  
>         $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : '';
>  
> -       if (array_key_exists('POST', $section_text) && 
> !empty($section_text['POST'])) {
> +       if (array_key_exists('POST_RAW', $section_text) && 
> !empty($section_text['POST_RAW'])) {
> +               $post = trim($section_text['POST_RAW']);
> +               $raw_lines = explode("\n", $post);
> +
> +               $request = '';
> +               foreach ($raw_lines as $line) {
> +                       if (empty($env['CONTENT_TYPE']) &&
> eregi('^(Content-Type:)(.*)', $line, $res)) {
> +                               $env['CONTENT_TYPE'] =
> trim(str_replace("\r", '', $res[2]));
> +                               continue;
> +                       }
> +                       $request .= $line . "\n";
> +               }
> +
> +               $env['CONTENT_LENGTH'] = strlen($request);
> +               $env['REQUEST_METHOD'] = 'POST';
> +
> +               if (empty($request)) {
> +                       return 'BORKED';
> +               }
> +               save_text($tmp_post, $request);
> +               $cmd = "$php$pass_options$ini_settings -f \"$test_file\" 2>&1 
> < $tmp_post";
> +       } elseif (array_key_exists('POST', $section_text) && 
> !empty($section_text['POST'])) {
>  
>                 $post = trim($section_text['POST']);
>                 save_text($tmp_post, $post);
> -               $content_length = strlen($post);
>  
> +               $content_length = strlen($post);
>                 $env['REQUEST_METHOD'] = 'POST';
>                 $env['CONTENT_TYPE']   = 'application/x-www-form-urlencoded';
>                 $env['CONTENT_LENGTH'] = $content_length;
>  
>                 $cmd = "$php$pass_options$ini_settings -f \"$test_file\" 2>&1 
> < $tmp_post";
> -
> +               save_text('/home/pierre/cmd.txt', $cmd);
>         } else {
>  
>                 $env['REQUEST_METHOD'] = 'GET';




Best regards,
 Marcus

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to