From: Stig Bakken Date: Sun, 22 Dec 2002 01:43:20 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.0~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e489050e18781ebebabe664edc91108f29a7cd2;p=php MFH --- diff --git a/pear/PEAR/Config.php b/pear/PEAR/Config.php index 0432fccfa9..f8dea8b234 100644 --- a/pear/PEAR/Config.php +++ b/pear/PEAR/Config.php @@ -149,7 +149,7 @@ if (isset($_ENV['PHP_PEAR_UMASK'])) { if (isset($_ENV['PHP_PEAR_CACHE_TTL'])) { define('PEAR_CONFIG_DEFAULT_CACHE_TTL', $_ENV['PHP_PEAR_CACHE_TTL']); } else { - define('PEAR_CONFIG_DEFAULT_CACHE_TTL', 0); + define('PEAR_CONFIG_DEFAULT_CACHE_TTL', 3600); } // Default for sig_type @@ -1136,4 +1136,4 @@ class PEAR_Config extends PEAR // }}} } -?> \ No newline at end of file +?> diff --git a/pear/System.php b/pear/System.php index fb2ecac674..c2e3d53c3f 100644 --- a/pear/System.php +++ b/pear/System.php @@ -419,17 +419,25 @@ class System */ function which($program, $fallback = false) { + // is_executable() is not available on windows + if (OS_WINDOWS) { + $pear_is_executable = 'is_file'; + } else { + $pear_is_executable = 'is_executable'; + } + // full path given if (basename($program) != $program) { - return (@is_executable($program)) ? $program : $fallback; + return (@$pear_is_executable($program)) ? $program : $fallback; } + // XXX FIXME honor safe mode $path_delim = OS_WINDOWS ? ';' : ':'; $exe_suffix = OS_WINDOWS ? '.exe' : ''; $path_elements = explode($path_delim, getenv('PATH')); foreach ($path_elements as $dir) { $file = $dir . DIRECTORY_SEPARATOR . $program . $exe_suffix; - if (@is_file($file) && @is_executable($file)) { + if (@is_file($file) && @$pear_is_executable($file)) { return $file; } }