From 846ad56a1390805aff2a0105c4990f3baf27606e Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Sat, 12 Oct 2002 14:17:44 +0000 Subject: * rename System::type to System::which --- pear/System.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pear/System.php') 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 */ - 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 -- cgit v1.2.1