Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teodoroleckie/config
⚡ Config is a lightweight configuration file loader. PHP
https://github.com/teodoroleckie/config
array-access config configuration php php-config php-configuration php8
Last synced: about 1 month ago
JSON representation
⚡ Config is a lightweight configuration file loader. PHP
- Host: GitHub
- URL: https://github.com/teodoroleckie/config
- Owner: teodoroleckie
- License: mit
- Created: 2021-04-24T08:00:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T07:19:07.000Z (over 3 years ago)
- Last Synced: 2024-09-28T20:41:03.830Z (about 2 months ago)
- Topics: array-access, config, configuration, php, php-config, php-configuration, php8
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Config PHP
[![Latest Version on Packagist](https://img.shields.io/packagist/v/tleckie/config.svg?style=flat-square)](https://packagist.org/packages/tleckie/config)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/teodoroleckie/config/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/teodoroleckie/config/?branch=main)
[![Total Downloads](https://img.shields.io/packagist/dt/tleckie/config.svg?style=flat-square)](https://packagist.org/packages/tleckie/config)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/teodoroleckie/config/badges/code-intelligence.svg?b=main)](https://scrutinizer-ci.com/code-intelligence)
[![Build Status](https://scrutinizer-ci.com/g/teodoroleckie/config/badges/build.png?b=main)](https://scrutinizer-ci.com/g/teodoroleckie/config/build-status/main)## Installation
You can install the package via composer:
```bash
composer require tleckie/config
```## Usage
```php
[
'name' => 'John',
'age' => 38,
'friend' => [
'name' => 'Mario',
'age' => 25,
'friend' => [
'name' => 'Pedro',
'age' => 48,
]
]
],
'size' => '800x900'
];
$config = new Config($data);var_dump($config->get('user')->get('friend')->get('friend')->get('name'));
var_dump($config->user->friend->friend->name);$config->merge(['name' => 'Pedro']);
$config->merge(new Config(['name' => 'Pedro']));```