Class Config
Loads a directory filled with JSON files allowing quick access to data
Methods summary
public
|
#
__construct( string $path = null )
Parameters
- $path
- absolute or relative directory path to a folder containing JSON files
|
public
mixed
|
#
get( string $dotNotation, mixed $defaultValue = null )
retrieves a value from the amalgamation of all the JSON files data
retrieves a value from the amalgamation of all the JSON files data
Parameters
- $dotNotation
- a concatenated string of array keys
- $defaultValue
- value to be returned if the dot notation does not find data
Returns
mixed
|
public
array
|
#
getFiles( string $path )
retrieves an array of JSON files found in a directory
retrieves an array of JSON files found in a directory
Parameters
- $path
- absolute or relative directory path to a folder containing JSON files
Returns
array retrieves an array of JSON files found in a directory
|
public
|
#
importData( array $files = [] )
loads data into the object from a list of JSON files. If run multiple times the data will be continually added to
loads data into the object from a list of JSON files. If run multiple times the data will be continually added to
Parameters
- $files
- list of files to be loaded
Returns
$this
|
public
|
#
load( string $path )
loads JSON files from a directory path
loads JSON files from a directory path
Parameters
- $path
- absolute or relative directory path to a folder containing JSON files
Returns
$this
|
public
DSchoenbauer\DotNotation\ArrayDotNotation
|
#
getArrayDot( )
Array dot notation allows for quick and easy access to a complicated data structure
Array dot notation allows for quick and easy access to a complicated data structure
Returns
DSchoenbauer\DotNotation\ArrayDotNotation
|
public
|
#
setArrayDot( DSchoenbauer\DotNotation\ArrayDotNotation $arrayDot )
Array dot notation allows for quick and easy access to a complicated data structure
Array dot notation allows for quick and easy access to a complicated data structure
Parameters
Returns
$this
|
public
string
|
#
filterPath( string $path )
Cleans a string so that it is truly a path relevant to the class.
Cleans a string so that it is truly a path relevant to the class.
Parameters
- $path
- absolute or relative directory path to a folder containing JSON files
Returns
string
|