cvs: pear /HTTP_WebDAV_Server/Server Filesystem.php

From: Date: Fri, 02 Jan 2004 20:35:26 +0000
Subject: cvs: pear /HTTP_WebDAV_Server/Server Filesystem.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-15290@lists.php.net to get a copy of this message
hholzgra Fri Jan 2 15:35:26 2004 EDT Modified files: /pear/HTTP_WebDAV_Server/Server Filesystem.php Log: finished implementation of _can_execute() Index: pear/HTTP_WebDAV_Server/Server/Filesystem.php diff -u pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.5 pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.6 --- pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.5 Tue Nov 18 16:14:04 2003 +++ pear/HTTP_WebDAV_Server/Server/Filesystem.php Fri Jan 2 15:35:25 2004 @@ -177,9 +177,14 @@ return $file; } - /* @@@ */ function _can_execute($name, $path=false) { + if (function_exists("is_executable")) { + $check_fn = "is_executable"; + } else { + $check_fn = "file_exists"; + } + if (!strncmp(PHP_OS, "WIN", 3)) { $exts = array(".exe", ".com"); } else { @@ -191,11 +196,14 @@ } foreach (explode(PATH_SEPARATOR, $path) as $dir) { - if (!@is_dir($dir)) continue; + if (!file_exists($dir)) continue; + if (!is_dir($dir)) continue; foreach ($exts as $ext) { - if (@is_executable("$dir/$name".$ext)) return true; + if ($check_fn("$dir/$name".$ext)) return true; } } + + return false; }

« previous php.pear.cvs (#15290) next »