Valhalla's file system utilities class adds useful functions for working with files and directories and for traversing the directory tree.
Here is a list of each of the available functions in FileSystem and how they can be used. Note that each of these functions is static and therefore can be called without instantiating any objects.
$recursive(Optional) Defaults to true.
$showDirectories(Optional) Defaults to true.
Return Value: An array of files and directories.
The function traverses a directory indicated by
and lists the files. If
is true, the function traverses the directory and sub-directories recursively.
is only really relevant when
is false. In this case, directories will be listed along with files in the resulting array, otherwise only files will be shown.