To manage files and directories anywhere on the server, use the
pm_ServerFileManager
class. This class enables you to perform the same operations as the
pm_FileManager class, but is applied in relation to server files. In
particular, it lets you create and remove files and directories, check
for existence of files and directories, read and write data to files,
and also change file and directory permissions (only on Linux).
Descriptions and usage examples for some of the methods can be found
below.
scanDir() - returns a list of files and directories inside the
specified path.
Usage
array scanDir(string $path [, bool $skipDots = false [, bool $showSystemFiles = true ]])
Parameters
-
path (type: string)
The directory that will be scanned.
-
skipDots (type: boolean, default value: false)
If the optional parameter skipDots is set to “true”, then the root
directories “..” and “.” will be excluded from the resulting array,
otherwise they will be included. -
showSystemFiles (type: boolean, default value: true)
If the optional parameter showSystemFiles is set to “true”, then
hidden files (for example, system files) will be included in
resulting array, otherwise they will be absent.
Return Values
Returns an array containing the files and directories in the directory.
Examples
Directory tree
$ ls -a var
. .. config.json .gitkeep
Example
$result = (new <…