Download the PHP package andrewdyer/settings without Composer
On this page you can find all versions of the php package andrewdyer/settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andrewdyer/settings
More information about andrewdyer/settings
Files in andrewdyer/settings
Package settings
Short Description A framework-agnostic PHP settings library for managing application configuration in a consistent and structured way
License MIT
Homepage https://github.com/andrewdyer/settings
Informations about the package settings
Settings
A framework-agnostic PHP settings library for managing application configuration in a consistent and structured way.
Introduction
This library provides a lightweight wrapper around a plain PHP array, exposing a clean interface for storing and retrieving application configuration values. It offers a straightforward, dependency-free way to manage configuration without coupling application code to a specific framework, making it easy to drop into any project or architecture.
Prerequisites
Installation
Getting Started
Create a AndrewDyer\Settings\Settings instance by passing in the configuration array.
Usage
Retrieve all settings
The entire settings array is returned by the all() method.
Retrieve a setting
A top-level setting is accessed by its key with the get() method.
The get() method can also access nested settings using dot notation.
Dot notation can traverse multiple levels of configuration.
Requesting a parent key with get() returns the entire nested configuration array.
Check if a setting exists
The has() method checks whether a top-level key exists.
The has() method also supports nested keys using dot notation.
Literal keys containing dots
If a top-level key contains dots, the exact key takes precedence over nested resolution.
If the exact key does not exist, the get() method falls back to resolving nested values using dot notation.
License
Licensed under the MIT license and is free for private or commercial projects.