SPHPlayground API
SPHPlayground
sphplayground sphplayground

Filesystem manipulation

The Filesystem is a utility class for filesystem manipulation. It can execute PHP-files and return the resulting HTML, text etc.

Filesystem has methods for:

Synopsis
Checks whether the file exists and is an actual file
public static isFile(string $filename):bool
public static isAsciiFile(string $filename):bool
Returns the entire file as a string
public static toString(string $path):string
Executes a PHP script and returns the result as a string
public static executePhpToString(string $path):string
Returns rows of the ASCII file in an array
public static getTextFileRows(string $path):array
Attempts to create the directory specified by pathname
public static mkdir(string $path, int $mode = 511):bool
Attempts to create the file specified by pathname
public static mkFile(string $path, int $mode = 511):bool
public static dirIsEmpty(string $dir):bool
Removes directory and all of its content
public static rmDir(string $directory):bool
public static rmFile(string $path):bool