olegv/config 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

olegv/config

最新稳定版本:v1.1.1

Composer 安装命令:

composer require olegv/config

包简介

Library for configuration and hiding secret data

README 文档

README

Library for configuration and hiding secret data

Features

  • lightweight
  • dependency-free
  • 100% test coverage
  • phpstan max lvl
  • phpstan full strict rules

Install

composer require olegv/config

Usage

  1. Create secret file somewhere($path_to_secret_file), it must return array<string, string>, for example:
    <?php
    $secret = [
        'very_secret' => 'your_secret_key_here2',
    ];
    return $secret;
  2. Create file with config array, example:
    <?php
    $config_array = [
        'secret' => $secret['very_secret'],
        'not_secret' => [
            'data1',
            'data2',
            'data3',
            'secret' => $secret['very_secret'],
        ],
    ];
    $config = new Config($path_to_secret_file, $config_array);
  3. If you need get secret data:
    $secret_lvl1 = $config['secret']->getValue();
    $secret_lvl2 = $config['not_secret']['secret']->getValue();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-06