Config
in package
implements
ConfigInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- $composer : mixed
- $appPath : mixed
- $composerJson : mixed
- __construct() : mixed
- composer() : mixed
- get() : mixed
- getDefault() : array<string|int, null|mixed|(null|bool|mixed|(mixed|string)[]|string)[]|string>
- isProd() : bool
- siteConfig() : array<string|int, mixed>
- loadComposerFile() : mixed
- multiMerge() : array<string|int, mixed>
- Merges two multi-dimensional arrays recursively.
Properties
$composer
public
mixed
$composer
$appPath
private
mixed
$appPath
$composerJson
private
static mixed
$composerJson
Methods
__construct()
public
__construct(string $appPath) : mixed
Parameters
- $appPath : string
Return values
mixed —composer()
public
composer([string|null $key = null ]) : mixed
Parameters
- $key : string|null = null
Return values
mixed —get()
public
get([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
Return values
mixed —getDefault()
public
static getDefault() : array<string|int, null|mixed|(null|bool|mixed|(mixed|string)[]|string)[]|string>
Tags
Return values
array<string|int, null|mixed|(null|bool|mixed|(mixed|string)[]|string)[]|string> —isProd()
public
static isProd(string $environment) : bool
Parameters
- $environment : string
Return values
bool —siteConfig()
public
siteConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —loadComposerFile()
protected
loadComposerFile([string|null $composerJsonPath = null ]) : mixed
Parameters
- $composerJsonPath : string|null = null
Return values
mixed —multiMerge()
Merges two multi-dimensional arrays recursively.
private
static multiMerge(array<string|int, mixed> $array1, array<string|int, mixed> $array2) : array<string|int, mixed>
This function will recursively merge the values of $array2
into $array1
.
If the same key exists in both arrays, and both corresponding values are arrays,
the values are recursively merged.
Otherwise, values from $array2
will overwrite those in $array1
.
Parameters
- $array1 : array<string|int, mixed>
-
The base array that will be merged into.
- $array2 : array<string|int, mixed>
-
The array with values to merge into
$array1
.
Return values
array<string|int, mixed> —The merged array.