PHP Classes

PHP Path Windows and Linux Utilities: Manage file and folder paths in Windows and Linux

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 168 All time: 8,828 This week: 135Up
Version License PHP version Categories
path-utilities 1.0.17BSD License5.6PHP 5, Files and Folders, Unix, Windows


This class can manage file and folder paths in Windows and Linux or other Unix systems.

It can perform several types of operations with file and directory paths in a way that works in different operating systems. Currently it can:

- Get the real path of a file, even if the file does not exists (which the builtin PHP function realpath() is unable to do)
- Walk through a directory, applying selection criterion in the same spirit as the Unix find command
- Get the full path of an executable file, provided it resides in one of the directories listed by your PATH environment variable. On Windows platforms, it also takes into account your PATHEXT environment variable to search for the appropriate binaries when no executable file extension has been specified.
- Match a wildcard against a filename, much like the MS-DOS style
- Get an ls style output for file permissions
- And many more utility functions, related to handling filename extensions

Innovation Award
PHP Programming Innovation award nominee
December 2016
Number 2

Prize: One year server license IP to country, region, city, latitude, longitude, ZIP code, time zone, area code database
PHP provides a good set of functions to access information of files and directories in a platform independent manner but some things are a little different between Windows and Linux or other Unix like platforms.

This package provides utility functions that can perform file and directory functions that are not available in PHP or have different ways of being implemented in different operation systems.

It can perform operations like getting the real path of a file that many not yet exist, search for files that match a criteria like the find command, get the path of executable commands considering the PATHEXT variable on Windows, etc..

Manuel Lemos
Picture of Christian Vigh
  Performance   Level  
Name: Christian Vigh <contact>
Classes: 32 packages by
Country: France France
Age: 57
All time rank: 13810 in France France
Week rank: 10 Up1 in France France Up
Innovation award
Innovation award
Nominee: 20x

Winner: 3x


// Demonstrates the use of the Path::Find() method
require ( 'Path.phpclass' ) ;

$dirname = dirname ( __FILE__ ) ;

if (
php_sapi_name ( ) != 'cli' )
'<pre>' ;

echo (
"List of files in the current directory :\n" ) ;
$result = Path ::Find ( $dirname ) ;
print_r ( $result ) ;

echo (
"\n\n" ) ;
echo (
"Details of files in the current directory :\n" ) ;
$result = Path ::Find ( $dirname, null, FIND_OPTIONS_ALL ) ;
print_r ( $result ) ;

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.find.php Example Example script
Accessible without login Plain text file example.realpath.php Example Example script
Plain text file Path.phpclass Class Class source
Accessible without login Plain text file Doc. Documentation

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:8,828
This week:135Up
 User Ratings  
 All time