Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Request #7559 fileExists method
Submitted: 2006-05-04 18:24 UTC
From: denny at php dot net Assigned: mike
Status: Closed Package: File (version 1.2.2)
PHP Version: Irrelevant OS: All
Roadmaps: 1.3.0a1    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2007-02-20 10:06 UTC
Package:
Bug Type:
Summary:
From: denny at php dot net
New email:
PHP Version: Package Version: OS:

 

 [2006-05-04 18:24 UTC] denny at php dot net (Denny Shimkoski)
Description: ------------ The following method checks for a file's existence, taking the current include path into consideration. Test script: --------------- /** * Checks for a file's existence, taking the current include path into consideration * * This method can be called statically (e.g., File_Util::fileExists('config.php')) * * @param string $filename * @param string $slash the directory separator (optional) * @return false|string * @access public * @static */ function fileExists($filename, $slash = DIRECTORY_SEPARATOR) { $includePath = ini_get('include_path'); if ($paths = explode(PATH_SEPARATOR, $includePath)) { foreach ($paths as $path) { $file = "$path$slash$filename"; if (file_exists($file)) { return $file; } } } return false; }

Comments

 [2007-02-20 10:06 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!