From ed7369f8c35489db8c97c2bf9093143b9fb30be0 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 9 Oct 2015 11:32:35 -0400 Subject: [PATCH 1/3] Add temporary workaround for known PHP bug This temporary workaround is intended to address an uncaught exception that may occur, until https://bugs.php.net/bug.php?id=69240 is fixed. Obviously the `@` operator is another option, but I'm erring towards the notion that the Symfony authors/maintainers may wish to implement more elegant exception-handling logic than simply using `@`. --- .../Component/Process/ExecutableFinder.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php index a9c0a5c8795bf..73c913daca0e0 100644 --- a/src/Symfony/Component/Process/ExecutableFinder.php +++ b/src/Symfony/Component/Process/ExecutableFinder.php @@ -56,13 +56,20 @@ public function find($name, $default = null, array $extraDirs = array()) $searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir')); $dirs = array(); foreach ($searchPath as $path) { - if (is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && is_executable($path)) { - return $path; + try { + if (is_dir($path)) { + $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( From cd6c5af9f8237b2d3182d746b2baf25126537db8 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 9 Oct 2015 12:27:12 -0400 Subject: [PATCH 2/3] Removed try/catch in favor of @ There you go. --- .../Component/Process/ExecutableFinder.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php index 73c913daca0e0..b78e82e877cf3 100644 --- a/src/Symfony/Component/Process/ExecutableFinder.php +++ b/src/Symfony/Component/Process/ExecutableFinder.php @@ -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)) { + $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( From abf7635f539ab2bc8952675750501845b7bb3438 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 9 Oct 2015 16:58:56 -0400 Subject: [PATCH 3/3] Added comment to explain the reason for the @ --- src/Symfony/Component/Process/ExecutableFinder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php index b78e82e877cf3..fa11cb6e402c6 100644 --- a/src/Symfony/Component/Process/ExecutableFinder.php +++ b/src/Symfony/Component/Process/ExecutableFinder.php @@ -56,6 +56,7 @@ public function find($name, $default = null, array $extraDirs = array()) $searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir')); $dirs = array(); foreach ($searchPath as $path) { + // Silencing against https://bugs.php.net/69240 if (@is_dir($path)) { $dirs[] = $path; } else { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy