\Phug\Renderer\PartialFileSystemTrait

Trait FileSystemTrait: require OptionInterface to be implemented.

Summary

Methods
Properties
Constants
scanDirectory()
scanDirectories()
emptyDirectory()
No public properties found
No constants found
fileMatchExtensions()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

scanDirectory()

scanDirectory(string  $directory, array  $extensions = null, callable  $directoryCallback = null, callable  $fileCallback = null) : \Phug\Renderer\Partial\iterable

Get all file matching extensions list recursively in a directory.

Parameters

string $directory

directory to scan for files

array $extensions

optional extensions to filter the result (use 'extensions' setting if omitted)

callable $directoryCallback

optional function/closure to call for each sub-directory scanned (after files have been yielded).

callable $fileCallback

optional function/closure to call after each file yielded.

Returns

\Phug\Renderer\Partial\iterable

scanDirectories()

scanDirectories(  $directories) : \Phug\Renderer\Partial\iterable

Get all file matching extensions list recursively in a directories list.

Parameters

$directories

Returns

\Phug\Renderer\Partial\iterable

emptyDirectory()

emptyDirectory(string  $directory) 

Remove all files and directories from a given directory.

Parameters

string $directory

directory to empty.

fileMatchExtensions()

fileMatchExtensions(string  $path, array  $extensions) : boolean

Returns true if the given path has one of the given extensions.

Parameters

string $path

file path

array $extensions

extensions list

Returns

boolean