functions.php
This file is part of php-fast-forward/config.
Description
This source file is subject to the license bundled with this source code in the file LICENSE.
Description
https://opensource.org/licenses/MIT MIT License
Functions
Creates a unified configuration object from various sources.
Creates a cached configuration object from various sources.
Creates a directory-based configuration provider.
Creates a configuration from a list of Laminas-style configuration providers.
Creates a unified configuration object from various sources.
config(
array<string|int, mixed>|ConfigInterface|string
...$configs) : ConfigInterface
Description
This function SHALL normalize and aggregate mixed input types such as arrays, directories, and Laminas configuration providers into a single configuration instance.
Parameters
Description
The configuration sources.
Return values
Description
the aggregated configuration instance
Creates a cached configuration object from various sources.
configCache(CacheInterface
$cache,
array<string|int, mixed>|ConfigInterface|string
...$configs) : ConfigInterface
Description
This function SHALL wrap the configuration in a caching layer using PSR-16 CacheInterface.
Parameters
$cache
:
CacheInterface
Description
the cache pool for storing configuration data
Description
The configuration sources.
Return values
Description
the cached configuration instance
Creates a directory-based configuration provider.
configDir(
string
$rootDirectory[,
bool
$recursive = false][,
string|null
$cachedConfigFile = null]) : ConfigInterface
Description
If the recursive flag is TRUE, nested directories SHALL be included in the scan. Configuration files MUST follow the PHP file format.
Parameters
$rootDirectory
:
string
Description
the directory to load configuration files from
$recursive
:
bool
=
false
Description
whether to include files in subdirectories recursively
$cachedConfigFile
:
string|null
=
null
Description
optional path to a cache file for the configuration
Return values
Description
the resulting configuration provider instance
Creates a configuration from a list of Laminas-style configuration providers.
configProvider(
iterable<string|int, mixed>
$providers[,
string|null
$cachedConfigFile = null]) : ConfigInterface
Description
Each provider MUST be invokable and return an array or configuration structure.
Parameters
$providers
:
iterable<string|int, mixed>
Description
a list of configuration providers
$cachedConfigFile
:
string|null
=
null
Description
optional path to a cache file for the configuration
Return values
Description
the resulting configuration instance