summaryrefslogtreecommitdiff
path: root/pear/System.php
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-10-12 14:17:44 +0000
committerStig Bakken <ssb@php.net>2002-10-12 14:17:44 +0000
commit846ad56a1390805aff2a0105c4990f3baf27606e (patch)
tree80a19a347d8ba2a7889a1e28a948f0c0f828dfa4 /pear/System.php
parentc0c85a8c770916d00e98659503fc1bdf3c1fd70a (diff)
downloadphp-git-846ad56a1390805aff2a0105c4990f3baf27606e.tar.gz
* rename System::type to System::which
Diffstat (limited to 'pear/System.php')
-rw-r--r--pear/System.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/pear/System.php b/pear/System.php
index 9808233cb9..712819d059 100644
--- a/pear/System.php
+++ b/pear/System.php
@@ -411,17 +411,17 @@ class System
}
/**
- * The "type" command (show the full path of a command)
+ * The "which" command (show the full path of a command)
*
* @param string $program The command to search for
* @return mixed A string with the full path or false if not found
* @author Stig Bakken <ssb@fast.no>
*/
- function type($program)
+ function which($program, $fallback = false)
{
// full path given
if (basename($program) != $program) {
- return (@is_executable($program)) ? $program : false;
+ return (@is_executable($program)) ? $program : $fallback;
}
// XXX FIXME honor safe mode
$path_delim = OS_WINDOWS ? ';' : ':';
@@ -433,7 +433,7 @@ class System
return $file;
}
}
- return false;
+ return $fallback;
}
}
?> \ No newline at end of file