承接 devuri/config 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devuri/config

最新稳定版本:v0.1.5

Composer 安装命令:

composer require devuri/config

包简介

A lightweight configuration management library for PHP applications.

README 文档

README

SimpleConfig is a lightweight PHP configuration management library designed to provide an easy and flexible way to handle configuration settings. It leverages dflydev/dot-access-data for convenient access to nested configuration values using dot notation.

Features

  • Easy loading and merging of configuration files.
  • Environment-specific configuration overrides.
  • Simple dot notation for accessing nested configuration values.
  • Optional caching mechanism to enhance performance.

Installation

Use Composer to install SimpleConfig into your project:

composer require devuri/config

Usage

Basic Usage

use Urisoft\SimpleConfig;

// Define your configuration path and allowed files
$configPath = __DIR__ . '/config';
$allowedFiles = ['app', 'database'];

// Instantiate the SimpleConfig object
$config = new SimpleConfig($configPath, $allowedFiles, 'production', 'path/to/configCache.php');

// Access configuration values
$appName = $config->get('app.name');
$dbHost = $config->get('database.connections.mysql.host');

Setting Configuration Values

// Set a new configuration value
$config->set('app.timezone', 'UTC');

// Retrieve the newly set value
echo $config->get('app.timezone'); // Outputs: UTC

Clearing Cache

// Manually clear the configuration cache
$config->clearCache();

Contributing

Please submit pull requests or create issues for any features, fixes, or improvements.

License

Licensed under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 11.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-20