UserFrosting API

FileRepositoryLoader

Loads repository data from a list of file paths.

Tags
author

Alexander Weissman (https://alexanderweissman.com)

Table of Contents

$paths string[]
__construct() Create the loader. mixed
parseFile() Fetch content from a single file path. array
load() Fetch and recursively merge in content from all file paths. string[]
loadFile() Fetch content from a single file path. array
isReadable() Return if path is readable. bool
addPath() Add a file path to the top of the stack. self
prependPath() Add a file path to the bottom of the stack. self
setPaths() Set the internal array of file paths. self
getPaths() Return a list of all file paths. string[]

Properties

Methods

__construct()

Create the loader.

public __construct( $paths : string|string[] ) : mixed
Parameters
$paths : string|string[]
Return values
mixed

parseFile()

Fetch content from a single file path.

protected abstract parseFile( $path : string ) : array
Parameters
$path : string
Return values
array

load()

Fetch and recursively merge in content from all file paths.

public load( [ $skipMissing : bool = true ] ) : string[]
Parameters
$skipMissing : bool = true
Return values
string[]

loadFile()

Fetch content from a single file path.

public loadFile( $path : string [, $skipMissing : bool = true ] ) : array
Parameters
$path : string
$skipMissing : bool = true

True to ignore bad file paths. If set to false, will throw an exception instead.

Tags
throws
FileNotFoundException
Return values
array

isReadable()

Return if path is readable.

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

addPath()

Add a file path to the top of the stack.

public addPath( $path : string ) : self
Parameters
$path : string
Return values
self

prependPath()

Add a file path to the bottom of the stack.

public prependPath( $path : string ) : self
Parameters
$path : string
Return values
self

setPaths()

Set the internal array of file paths.

public setPaths( $paths : string|string[] ) : self
Parameters
$paths : string|string[]
Return values
self

getPaths()

Return a list of all file paths.

public getPaths( ) : string[]
Return values
string[]

Search results