Documentation

LocalFileReader
in package
implements FileReader

Description of LocalFileReader.

Table of Contents

Interfaces

FileReader
Interface describing the operations required for reading browsing files (read-only).

Properties

$root  : string
$validFilepath  : string

Methods

__construct()  : mixed
downloadFile()  : bool|Stream
Either redirects the user to a location to download the file in $path or directly sends this file to the user. Returns false on failure.
isAllowed()  : bool
Returns whether the given $path is allowed to be accessed.
isDir()  : bool
Returns whether the given $path is valid and is a directory.
listDir()  : array<string|int, FileNode>|null
Return an array of all files and subdirectories in the given directory.
interpretDirContent()  : false|string
isValidPathName()  : bool

Properties

Methods

__construct()

public __construct(string $root, string $validFilepath) : mixed
Parameters
$root : string
$validFilepath : string

downloadFile()

Either redirects the user to a location to download the file in $path or directly sends this file to the user. Returns false on failure.

public downloadFile(string $path) : bool|Stream
Parameters
$path : string
Return values
bool|Stream

isAllowed()

Returns whether the given $path is allowed to be accessed.

public isAllowed(string $path) : bool
Parameters
$path : string
Return values
bool

isDir()

Returns whether the given $path is valid and is a directory.

public isDir(string $path) : bool
Parameters
$path : string
Return values
bool

listDir()

Return an array of all files and subdirectories in the given directory.

public listDir(string $path) : array<string|int, FileNode>|null
Parameters
$path : string
Return values
array<string|int, FileNode>|null

interpretDirContent()

protected interpretDirContent(string $dirContent, string $fullPath) : false|string
Parameters
$dirContent : string
$fullPath : string
Return values
false|string

isValidPathName()

protected isValidPathName(string $path) : bool
Parameters
$path : string
Return values
bool

        
On this page

Search results