phasync
StaticFiles / __construct

Method

StaticFiles::__construct

Serve the files below $directory.

Description#

public StaticFiles::__construct(
    string $directory
)

Parameters#

$directory string
The document root; resolved to its real path now

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionWhen $directory is not a directory

Examples#

Example 1
$files = new StaticFiles(__DIR__ . '/public');