Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generated/8.1/functionsList.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions generated/8.1/rector-migrate.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions generated/8.2/exec.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions generated/8.3/exec.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions generated/8.4/exec.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions generated/8.5/exec.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions lib/special_cases.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Safe\Exceptions\PcreException;
use Safe\Exceptions\SimplexmlException;
use Safe\Exceptions\FilesystemException;
use Safe\Exceptions\ExecException;

use const PREG_NO_ERROR;

Expand Down Expand Up @@ -399,3 +400,31 @@
}
return $safeResult;
}

/**
* The passthru function is similar to the
* exec function in that it executes a
* command. This function
* should be used in place of exec or
* system when the output from the Unix command
* is binary data which needs to be passed directly back to the
* browser. A common use for this is to execute something like the
* pbmplus utilities that can output an image stream directly. By
* setting the Content-type to image/gif and
* then calling a pbmplus program to output a gif, you can create
* PHP scripts that output images directly.
*
* @param string $command The command that will be executed.
* @param int|null $result_code If the result_code argument is present, the
* return status of the Unix command will be placed here.
* @throws ExecException
*
*/
function passthru(string $command, ?int &$result_code = null): void

Check failure on line 423 in lib/special_cases.php

View workflow job for this annotation

GitHub Actions / Generated Tests (8.1)

Function Safe\passthru() never assigns null to &$result_code so it can be removed from the by-ref type.

Check failure on line 423 in lib/special_cases.php

View workflow job for this annotation

GitHub Actions / Generated Tests (8.4)

Function Safe\passthru() never assigns null to &$result_code so it can be removed from the by-ref type.

Check failure on line 423 in lib/special_cases.php

View workflow job for this annotation

GitHub Actions / Generated Tests (8.2)

Function Safe\passthru() never assigns null to &$result_code so it can be removed from the by-ref type.

Check failure on line 423 in lib/special_cases.php

View workflow job for this annotation

GitHub Actions / Generated Tests (8.3)

Function Safe\passthru() never assigns null to &$result_code so it can be removed from the by-ref type.
Comment thread
silasjoisten marked this conversation as resolved.
{
error_clear_last();
$safeResult = \passthru($command, $result_code);
if ($safeResult === false) {
throw ExecException::createFromPhpError();
}
}
Loading