Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60836ff

Browse files
bug #46291 [Console] Suppress unhandled error in some specific use-cases. (rw4lll)
This PR was merged into the 5.4 branch. Discussion ---------- [Console] Suppress unhandled error in some specific use-cases. | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> If the package is used not in console with open_basedir enabled, since 5.4 it fails with unhandled php error here: (https://github.com/symfony/console/blob/06974380c667d7d8e3cd0f24bf51f816a71ca6c6/Command/DumpCompletionCommand.php#L44) because of trying to call realpath("/") and, of course, it's not allowed. It's a very specific use-case for Symfony, but can happen if it's used as dependency, e.g. in Laravel. I've described it in details here: laravel/framework#42171 I think that the best would be just suppress the error in that case. Commits ------- d975ca7 Suppress unhandled error in some specific use-cases.
2 parents b07093b + d975ca7 commit 60836ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Command/DumpCompletionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function configure()
4141
{
4242
$fullCommand = $_SERVER['PHP_SELF'];
4343
$commandName = basename($fullCommand);
44-
$fullCommand = realpath($fullCommand) ?: $fullCommand;
44+
$fullCommand = @realpath($fullCommand) ?: $fullCommand;
4545

4646
$this
4747
->setHelp(<<<EOH

0 commit comments

Comments
 (0)