File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / sapi / cli / tests / php_cli_server_017.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:13 2013 UTC (10 years, 11 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

    1: --TEST--
    2: Implement Req #60850 (Built in web server does not set $_SERVER['SCRIPT_FILENAME'] when using router)
    3: --SKIPIF--
    4: <?php
    5: include "skipif.inc"; 
    6: ?>
    7: --FILE--
    8: <?php
    9: include "php_cli_server.inc";
   10: php_cli_server_start(<<<'PHP'
   11: var_dump($_SERVER['SCRIPT_FILENAME']);
   12: PHP
   13: );
   14: 
   15: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
   16: $port = intval($port)?:80;
   17: 
   18: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
   19: if (!$fp) {
   20:   die("connect failed");
   21: }
   22: 
   23: if(fwrite($fp, <<<HEADER
   24: POST / HTTP/1.1
   25: Host: {$host}
   26: 
   27: 
   28: HEADER
   29: )) {
   30: 	while (!feof($fp)) {
   31: 		echo fgets($fp);
   32: 	}
   33: }
   34: 
   35: fclose($fp);
   36: ?>
   37: --EXPECTF--
   38: HTTP/1.1 200 OK
   39: Host: %s
   40: Connection: close
   41: X-Powered-By: %s
   42: Content-type: text/html
   43: 
   44: string(%d) "%sindex.php"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>