Skip to content

codemonster-ru/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

This repository is read-only.

Development happens in the Annabel monorepo: https://github.com/codemonster-ru/annabel

Issues and pull requests should be opened there.

codemonster-ru/config

Latest Version on Packagist Total Downloads License Tests

Simple configuration loader and helper for PHP applications.

📦 Installation

composer require codemonster-ru/config

🚀 Usage

1. Load config files

use Codemonster\Config\Config;

Config::load(__DIR__ . '/config');

2. Access config values

use Codemonster\Config\Config;

// get values
$name = Config::get('app.name', 'Default');
$dbHost = Config::get('database.host');

// set values dynamically
Config::set('app.debug', true);

// get all configs
$all = Config::all();

📄 Example config file (config/app.php)

<?php

return [
    'name' => 'Codemonster',
    'debug' => false,
];

🧪 Testing

composer test

👨‍💻 Author

Kirill Kolesnikov

📜 License

MIT