Req #54004 [NEW]: proc_open() should accept php:// wrappers for file

From: Date: Sat, 12 Feb 2011 23:59:04 +0000
Subject: Req #54004 [NEW]: proc_open() should accept php:// wrappers for file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158735@lists.php.net to get a copy of this message
From:             
Operating system: Linux (Ubuntu x86)
PHP version:      trunk-SVN-2011-02-12 (snap)
Package:          Unknown/Other Function
Bug Type:         Feature/Change Request
Bug description:proc_open() should accept php:// wrappers for file

Description:
------------
---
From manual page: http://www.php.net/function.proc-open
---

proc_open() can attach files for the child process' standard
input/output/error, 
but can't attach php:// wrapper. As far as I tried, http:// wrapper works
fine.

If wrappers can be used for proc_open(), in many cases I think we can avoid

complicated stream_select() programming using non-blocking i/o, as 
dk at brightbyte dot de does in http://www.php.net/function.shell-exec.php
.

Test script:
---------------
<?php
header("Content-Type: application/octet-stream");
proc_close(proc_open("zcat",
array(
   0 => array("file", "php://input", "r"),
   1 => array("file", "php://output", "w"),
   2 => array("file", "/dev/null", "a")
), $pipes));


Expected result:
----------------
Ungzip'ed content should be displayed when HTTP POST with gzip'ed request
body or 
when executed in CLI with gzip'ed standard input.

Actual result:
--------------
$ ~/local/php-trunk-20110212/bin/php -v
PHP 5.3.99-dev (cli) (built: Feb 13 2011 08:00:27) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies
$ ~/local/php-trunk-20110212/bin/php zcat.php < /usr/share/doc/php5/TODO.gz


Warning: proc_open(): cannot represent a stream of type Input as a File 
Descriptor in /path/to/zcat.php on line 8

Warning: proc_close() expects parameter 1 to be resource, boolean given in

/path/to/zcat.php on line 8

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54004&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54004&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54004&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54004&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54004&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54004&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54004&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54004&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54004&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54004&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54004&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54004&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54004&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54004&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54004&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54004&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54004&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54004&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54004&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54004&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54004&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54004&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#158735) next »