Download the PHP package iviphp/config without Composer
On this page you can find all versions of the php package iviphp/config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iviphp/config
More information about iviphp/config
Files in iviphp/config
Package config
Short Description Configuration loading and management for the IviPHP ecosystem.
License MIT
Informations about the package config
Ivi Config
Configuration loading and management for the IviPHP ecosystem.
Overview
iviphp/config provides a lightweight configuration system for IviPHP packages and applications.
It loads PHP configuration files into a central repository and supports nested values through dot notation.
Each configuration file must return an array.
For example:
The file config/database.php becomes available through keys such as:
Installation
Requirements
- PHP 8.2 or later
- Composer
iviphp/support
Loading configuration files
Each file inside the directory must return an array.
The filename becomes the root configuration key.
Creating configuration from an array
A repository can also be created directly from an existing array.
Reading configuration values
When the key does not exist, the provided default value is returned.
Retrieve all configuration values:
Checking configuration values
Updating configuration values
Removing configuration values
Merging configuration values
Nested arrays are merged recursively.
Replacing configuration
This removes the existing configuration and replaces it entirely.
Available classes
Config
Loads configuration files or creates a repository from an array.
ConfigRepository
Stores and manages configuration values.
ConfigException
Represents configuration loading failures, including:
- missing configuration directories;
- unreadable directories;
- directory scanning failures;
- configuration files that do not return arrays.
Design principles
- PHP array configuration files
- Nested access through dot notation
- No global state
- No static configuration repository
- Small and predictable API
- No framework runtime dependency
- Clear exceptions for invalid configuration
This package is responsible only for loading and managing configuration values.
Environment file loading, application bootstrapping and production configuration compilation belong to higher-level IviPHP components.
Ecosystem
This package is part of the IviPHP ecosystem:
iviphp/contractsiviphp/supportiviphp/containeriviphp/httpiviphp/databaseiviphp/validationiviphp/cacheiviphp/viewiviphp/framework
Contributing
Contributions should preserve the focused scope of this package.
New features should:
- remain independent from the full framework;
- avoid global configuration state;
- preserve predictable dot-notation behavior;
- avoid adding unrelated environment or application lifecycle responsibilities.
Security
Please report security issues privately to the Softadastra maintainers instead of opening a public issue.
License
This project is licensed under the MIT License.
Maintainer
Created and maintained by Softadastra.