FileLocator
class FileLocator implements FileLocatorInterface
FileLocator uses an array of pre-defined paths to find files.
Properties
Methods
| __construct(string|string[] $paths = array()) | |
string|array | locate(string $name, string|null $currentPath = null, bool $first = true) Returns a full path for a given file name. | |
Details
__construct(string|string[] $paths = array())
Parameters
string|string[] | $paths | A path or an array of paths where to look for resources |
string|array
locate(string $name, string|null $currentPath = null, bool $first = true)
Returns a full path for a given file name.
Parameters
string | $name | The file name to locate |
string|null | $currentPath | The current path |
bool | $first | Whether to return the first occurrence or an array of filenames |
Return Value
string|array | The full path to the file or an array of file paths |
Exceptions