Download the PHP package solophp/configs without Composer
On this page you can find all versions of the php package solophp/configs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download solophp/configs
More information about solophp/configs
Files in solophp/configs
Package configs
Short Description Simple and flexible configuration management library with dot notation support
License MIT
Informations about the package configs
Solo Configs
Solo Configs is a simple PHP package for managing configuration settings in your application. It provides easy access to configuration values using dot notation and supports default values if a key is not found.
Requirements
- PHP 8.1 or higher
Installation
You can install the package via Composer:
Usage
Create an instance of Configs
by passing an array of configurations. You can then retrieve values using dot notation.
Basic Usage
Configuration Structure
Your configuration array can be as deeply nested as needed:
API Reference
Methods
Constructor
Creates a new Configs instance.
Parameters:
array $configs
: Configuration array
Get Configuration Value
Retrieves a configuration value using dot notation.
Parameters:
string $key
: Configuration key using dot notation (optional)mixed $default
: Default value if key not found
Returns: Configuration value or default if not found
Magic Property Access
Magic method for property access (limited functionality in PHP).
Parameters:
string $key
: Configuration key
Returns: Configuration value or null if not found
Note: Due to PHP limitations with property names containing special characters, it's recommended to use the get()
method directly.
Development
Running Tests
Code Style
Check code style:
Fix code style:
License
This package is open-source and available under the MIT License.