duyler/config

Duyler config file loader

dev-main 2025-05-05 04:33 UTC

This package is auto-updated.

Last update: 2025-05-05 04:36:01 UTC


README

Quality Gate Status Coverage PHP Version

Duyler Config

Description

Duyler Config is a powerful and flexible configuration management library for PHP applications. It provides a simple and intuitive way to handle configuration files and environment variables in your projects.

Features

  • 🔄 Recursive configuration file loading
  • 🌍 Environment variables support with .env files
  • 💾 Configuration caching for better performance
  • 🔒 Type-safe configuration values
  • 🛠 Extensible through interfaces
  • 🚀 PHP 8.3+ support

Installation

composer require duyler/config

Basic Usage

use Duyler\Config\FileConfig;

// Initialize config
$config = new FileConfig(
    configDir: 'config',
    rootFile: 'composer.json'
);

// Get configuration value
$value = $config->get('app', 'name', 'default');

// Get environment variable
$env = $config->env('APP_ENV', 'production');

Requirements

  • PHP 8.3 or higher
  • Composer

License

This project is licensed under the MIT License - see the LICENSE file for details.