summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-12-22 01:43:20 +0000
committerStig Bakken <ssb@php.net>2002-12-22 01:43:20 +0000
commit5e489050e18781ebebabe664edc91108f29a7cd2 (patch)
tree4a6d8215587e947f1c5de8c470a73c589c1f7ac7
parent4100b87e386ee2f5e81dfbc5093cf1069acec677 (diff)
downloadphp-git-5e489050e18781ebebabe664edc91108f29a7cd2.tar.gz
MFH
-rw-r--r--pear/PEAR/Config.php4
-rw-r--r--pear/System.php12
2 files changed, 12 insertions, 4 deletions
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;
}
}