8000 [Process] Workaround buggy PHP warning by cbj4074 · Pull Request #16182 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Process] Workaround buggy PHP warning #16182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed try/catch in favor of @
There you go.
  • Loading branch information
cbj4074 committed Oct 9, 2015
commit cd6c5af9f8237b2d3182d746b2baf25126537db8
17 changes: 5 additions & 12 deletions src/Symfony/Component/Process/ExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,13 @@ public function find($name, $default = null, array $extraDirs = array())
$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));
$dirs = array();
foreach ($searchPath as $path) {
try {
if (is_dir($path)) {
$dirs[] = $path;
} else {
if (basename($path) == $name && is_executable($path)) {
return $path;
}
if (@is_dir($path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you just add a comment like this one please?

// Silencing against https://bugs.php.net/69240

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Please let me know if you had something different in mind. Thanks!

$dirs[] = $path;
} else {
if (basename($path) == $name && is_executable($path)) {
return $path;
}
}
catch (\ErrorException $e) {
//There is a bug in PHP that causes an exception to be
//thrown when the directory does not exist.
//See: https://bugs.php.net/bug.php?id=69240
}
}
} else {
$dirs = array_merge(
Expand Down
0