PHP Class Themosis\Finder\Finder

Inheritance: implements Themosis\Finder\IFinder
Show file Open project: themosis/framework

Protected Properties

Property Type Description
$extensions array Allowed file extensions.
$files array $key is the file name or relative path. $value is the file full path.
$paths array List of given/registered paths.

Public Methods

Method Description
addPaths ( array $paths ) Register multiple file paths.
find ( string $name ) : string Returns the file path.
getFiles ( ) : array Return a list of found files.
getPaths ( ) : array Return a list of registered paths.

Protected Methods

Method Description
addPath ( string $key, string $path ) Register a path.
findInPaths ( string $name, array $paths ) : array Look after a file in registered paths.
getPossibleFiles ( string $name ) : array Returns a list of possible file names.

Method Details

addPath() protected method

Register a path.
protected addPath ( string $key, string $path )
$key string The file URL if defined or numeric index.
$path string

addPaths() public method

Register multiple file paths.
public addPaths ( array $paths )
$paths array

find() public method

Returns the file path.
public find ( string $name ) : string
$name string The file name or relative path.
return string

findInPaths() protected method

Look after a file in registered paths.
protected findInPaths ( string $name, array $paths ) : array
$name string The file name or relative path.
$paths array Registered paths.
return array

getFiles() public method

Return a list of found files.
public getFiles ( ) : array
return array

getPaths() public method

Return a list of registered paths.
public getPaths ( ) : array
return array

getPossibleFiles() protected method

Returns a list of possible file names.
protected getPossibleFiles ( string $name ) : array
$name string The file name or relative path.
return array

Property Details

$extensions protected property

Allowed file extensions.
protected array $extensions
return array

$files protected property

$key is the file name or relative path. $value is the file full path.
protected array $files
return array

$paths protected property

List of given/registered paths.
protected array $paths
return array