]> granicus.if.org Git - php/commitdiff
MFH
authorStig Bakken <ssb@php.net>
Sun, 22 Dec 2002 01:43:20 +0000 (01:43 +0000)
committerStig Bakken <ssb@php.net>
Sun, 22 Dec 2002 01:43:20 +0000 (01:43 +0000)
pear/PEAR/Config.php
pear/System.php

index 0432fccfa9c44488c6e4981893164219021e3823..f8dea8b234f79e34eb6ef8fbe80a6a3997a00a4b 100644 (file)
@@ -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
+?>
index fb2ecac6746734be170d9f362696a5ee0d35c115..c2e3d53c3f7a57105ce1e61e28e3371e1c262b1c 100644 (file)
@@ -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;
             }
         }