Skip to content

Commit fae523f

Browse files
authored
Automatically regenerate the files
1 parent 68096ae commit fae523f

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

generated/exec.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,35 @@ function exec(string $command, ?array &$output = null, ?int &$result_code = null
4343
}
4444

4545

46+
/**
47+
* The passthru function is similar to the
48+
* exec function in that it executes a
49+
* command. This function
50+
* should be used in place of exec or
51+
* system when the output from the Unix command
52+
* is binary data which needs to be passed directly back to the
53+
* browser. A common use for this is to execute something like the
54+
* pbmplus utilities that can output an image stream directly. By
55+
* setting the Content-type to image/gif and
56+
* then calling a pbmplus program to output a gif, you can create
57+
* PHP scripts that output images directly.
58+
*
59+
* @param string $command The command that will be executed.
60+
* @param int|null $result_code If the result_code argument is present, the
61+
* return status of the Unix command will be placed here.
62+
* @throws ExecException
63+
*
64+
*/
65+
function passthru(string $command, ?int &$result_code = null): void
66+
{
67+
error_clear_last();
68+
$result = \passthru($command, $result_code);
69+
if ($result === false) {
70+
throw ExecException::createFromPhpError();
71+
}
72+
}
73+
74+
4675
/**
4776
* proc_nice changes the priority of the current
4877
* process by the amount specified in priority. A

generated/functionsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@
693693
'parse_ini_file',
694694
'parse_ini_string',
695695
'parse_url',
696+
'passthru',
696697
'pcntl_getpriority',
697698
'pcntl_setpriority',
698699
'pcntl_signal',

rector-migrate.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@
703703
'parse_ini_file' => 'Safe\parse_ini_file',
704704
'parse_ini_string' => 'Safe\parse_ini_string',
705705
'parse_url' => 'Safe\parse_url',
706+
'passthru' => 'Safe\passthru',
706707
'pcntl_getpriority' => 'Safe\pcntl_getpriority',
707708
'pcntl_setpriority' => 'Safe\pcntl_setpriority',
708709
'pcntl_signal' => 'Safe\pcntl_signal',

0 commit comments

Comments
 (0)