Filesystem
in package
Table of Contents
- correctDS() : string
- Corrects the Directory Separators of a path to unix style
- findFiles() : array<string|int, mixed>
- Find all files recursively in a directory
- getFileExtension() : string
- Gets the extension from the specified file
- hasFileExtension() : bool
- Checks if the filename matches (one of) the extension(s)
- isSymbolicLink() : mixed
Methods
correctDS()
Corrects the Directory Separators of a path to unix style
public
static correctDS(string $path) : string
Parameters
- $path : string
Return values
string —findFiles()
Find all files recursively in a directory
public
static findFiles(string $path[, string $filter = '' ]) : array<string|int, mixed>
Parameters
- $path : string
-
the directory to scan
- $filter : string = ''
-
the extensions of files to allow, can be regex
Tags
Return values
array<string|int, mixed> —the files that have been found
getFileExtension()
Gets the extension from the specified file
public
static getFileExtension(string $filename) : string
Parameters
- $filename : string
-
the filename to get the extension from
Return values
string —the extension, empty if not applicable
hasFileExtension()
Checks if the filename matches (one of) the extension(s)
public
static hasFileExtension(string $filename, array<string|int, mixed> $validExtensions) : bool
Parameters
- $filename : string
-
the filename to check
- $validExtensions : array<string|int, mixed>
-
the valid extension(s)
Return values
bool —true if matching
isSymbolicLink()
public
static isSymbolicLink(mixed $target) : mixed
Parameters
- $target : mixed