+++ /dev/null
-<?php
-
-function create_sleep_script()
-{
- $fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
-
- if (!file_exists($fname)) {
- file_put_contents($fname, "<?php\nsleep(1);\n");
- }
-
- return $fname;
-}
-
-function unlink_sleep_script()
-{
- $fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";
-
- if (file_exists($fname)) {
- unlink($fname);
- }
-}
--FILE--
<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
for ($i = 3; $i<= 30; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
-?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
?>
--EXPECTF--
int(28)
--FILE--
<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
$spec = array();
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
proc_open("$php -n $callee", $spec, $pipes);
var_dump(count($spec));
var_dump($pipes);
-?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
?>
--EXPECT--
int(0)
--FILE--
<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
for ($i = 3; $i<= 5; $i++) {
$spec[$i] = array('pipe', 'w');
}
$php = getenv("TEST_PHP_EXECUTABLE");
-$callee = create_sleep_script();
+$callee = __DIR__ . "/proc_open_pipes_sleep.inc";
$spec[$i] = array('pi');
proc_open("$php -n $callee", $spec, $pipes);
var_dump($pipes);
echo "END\n";
-?>
---CLEAN--
-<?php
-include dirname(__FILE__) . "/proc_open_pipes.inc";
-
-unlink_sleep_script();
-
?>
--EXPECTF--
Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d
--- /dev/null
+<?php
+sleep(1);