YamlFileLoader extends FileRepositoryLoader
Load content from yaml/json files.
Tags
Table of Contents
$paths | string[] | |
---|---|---|
parseFile() | Fetch content from a single file path. | array |
fileGetContents() | Reads entire path into a string. | string|bool |
__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
$paths
protected
string[]
$paths
= []
Methods
parseFile()
Fetch content from a single file path.
protected
parseFile(
$path :
string
)
: array
Parameters
- $path : string
Return values
arrayfileGetContents()
Reads entire path into a string.
protected
fileGetContents(
$path :
string
)
: string|bool
Parameters
- $path : string
Return values
string|bool__construct()
Create the loader.
public
__construct(
$paths :
string|string[]
)
: mixed
Parameters
- $paths : string|string[]
Return values
mixedparseFile()
Fetch content from a single file path.
protected
abstract parseFile(
$path :
string
)
: array
Parameters
- $path : string
Return values
arrayload()
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
Return values
arrayisReadable()
Return if path is readable.
protected
isReadable(
$path :
string
)
: bool
Parameters
- $path : string
Return values
booladdPath()
Add a file path to the top of the stack.
public
addPath(
$path :
string
)
: self
Parameters
- $path : string
Return values
selfprependPath()
Add a file path to the bottom of the stack.
public
prependPath(
$path :
string
)
: self
Parameters
- $path : string
Return values
selfsetPaths()
Set the internal array of file paths.
public
setPaths(
$paths :
string|string[]
)
: self
Parameters
- $paths : string|string[]
Return values
selfgetPaths()
Return a list of all file paths.
public
getPaths(
)
: string[]